Skip to content

Commit

Permalink
cmd/cue: improve cue vet examples' argument order
Browse files Browse the repository at this point in the history
This changes the "cue vet" help text by modifying the order in which
examples of the subcommand being used to validate non-CUE files refer to
their CUE and non-CUE files.

When individual CUE files (not packages) are used by "cue vet", then the
order in which the CUE and non-CUE files are mentioned doesn't matter.
But when a user explores how to use CUE packages in place of explicit
CUE files, then the order matters. If the non-CUE file is mentioned
first, followed by a CUE package, an error occurs.

This change nudges the reader towards an invocation that will work if
they use CUE packages, whilst still working when the commands are used
verbatim, with individual CUE files.

Also: in passing, clarify a sentence mentioning multiple expressions.

Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I20a8530d288bd7a030e24c90f12bee3f9f6748e8
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193603
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Paul Jolly <[email protected]>
  • Loading branch information
jpluscplusm authored and myitcv committed May 9, 2024
1 parent fdebcd9 commit fbe004d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/cue/cmd/vet.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ a set of definitions to pick from.
Examples:
# Check files against a CUE file:
cue vet foo.yaml foo.cue
cue vet foo.cue foo.yaml
# Check files against a particular expression
cue vet translations/*.yaml foo.cue -d '#Translation'
cue vet foo.cue translations/*.yaml -d '#Translation'
If more than one expression is given, all must match all values.
More than one expression may be given using multiple -d flags. Each non-CUE
file must match all expression values.
`

func newVetCmd(c *Command) *cobra.Command {
Expand Down

0 comments on commit fbe004d

Please sign in to comment.