Skip to content

Commit

Permalink
cmd/cue: point "help get" text at CUE-specific cmd
Browse files Browse the repository at this point in the history
This updates the "cue help get" text to make it clear that "cue get"
doesn't interact with CUE dependencies. For CUE modules, it updates two
help texts by pointing the reader onwards to "cue help modules", and
from there to "cue help mod".

Also: fix a typo (which was the initial motivation for this edit)

Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I2a980be042fe544c95a71c8b46a20616cb7c4bd6
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198447
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
  • Loading branch information
jpluscplusm authored and mvdan committed Jul 26, 2024
1 parent 8145bdd commit 5de5b42
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
15 changes: 9 additions & 6 deletions cmd/cue/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ import (
func newGetCmd(c *Command) *cobra.Command {
cmd := &cobra.Command{
Use: "get <language> [packages]",
Short: "add dependencies to the current module",
Long: `Get downloads packages or modules for CUE or another language
Short: "add non-CUE dependencies to the current module",
Long: `Get downloads packages or modules for non-CUE languages
to include them in the module's pkg directory.
Get requires an additional language field to determine for which
language definitions should be fetched. If get fetches definitions
for a language other than CUE, the definitions are extracted from
the source of the respective language and stored.
The specifics on how dependencies are fechted and converted vary
language definitions should be fetched. Definitions are extracted
from the source of the respective language and stored.
The specifics on how dependencies are fetched and converted vary
per language and are documented in the respective subcommands.
For information on native CUE modules:
cue help modules
`,
RunE: mkRunE(c, func(cmd *Command, args []string) error {
stderr := cmd.Stderr()
Expand Down
4 changes: 4 additions & 0 deletions cmd/cue/cmd/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ For a detailed reference on modules:
https://cuelang.org/docs/reference/modules/
For information on commands that interact with modules:
cue help mod
For tutorials on how to use the Central Registry, see:
https://cuelang.org/docs/tutorial/working-with-the-central-registry/
Expand Down
2 changes: 1 addition & 1 deletion cmd/cue/cmd/testdata/script/help.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Available Commands:
export output data in a standard format
fix rewrite packages to latest standards
fmt formats CUE configuration files
get add dependencies to the current module
get add non-CUE dependencies to the current module
help show help text for a command or topic
import convert other formats to CUE files
login log into a CUE registry
Expand Down

0 comments on commit 5de5b42

Please sign in to comment.