Skip to content

Commit

Permalink
cmd/cue: update mod docs
Browse files Browse the repository at this point in the history
The `cue mod tidy` command didn't have an intro,
and `cue mod publish` did not mention `$CUE_REGISTRY`.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I1dc7ce7cad420bcb83b8dcc6eb3f816481c3442a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1176758
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@gmail.com>
  • Loading branch information
rogpeppe committed Feb 19, 2024
1 parent 057c324 commit fa30d88
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
10 changes: 8 additions & 2 deletions cmd/cue/cmd/modpublish.go
Expand Up @@ -34,8 +34,14 @@ func newModUploadCmd(c *Command) *cobra.Command {
Short: "publish the current module to a registry",
Long: `WARNING: THIS COMMAND IS EXPERIMENTAL.
Publish the current module to an OCI registry.
Also note that this command does no dependency or other checks at the moment.
Publish the current module to an OCI registry. It consults
$CUE_REGISTRY to determine where the module should be published (see
"cue help environment" for details). Also note that this command does
no dependency or other checks at the moment.
Note: you must enable the modules experiment with:
export CUE_EXPERIMENT=modules
for this command to work.
`,
RunE: mkRunE(c, runModUpload),
Args: cobra.ExactArgs(1),
Expand Down
16 changes: 15 additions & 1 deletion cmd/cue/cmd/modtidy.go
Expand Up @@ -33,7 +33,21 @@ func newModTidyCmd(c *Command) *cobra.Command {
Short: "download and tidy module dependencies",
Long: `WARNING: THIS COMMAND IS EXPERIMENTAL.
Currently this command must be run in the module's root directory.
Tidy resolves all module dependencies in the current module and updates
the cue.mod/module.cue file to reflect them.
It also removes dependencies that are not needed.
It will attempt to fetch modules that aren't yet present in the
dependencies by fetching the latest available version from
a registry.
See "cue help environment" for details on how $CUE_REGISTRY is used to
determine the modules registry.
Note: you must enable the modules experiment with:
export CUE_EXPERIMENT=modules
for this command to work.
`,
RunE: mkRunE(c, runModTidy),
Args: cobra.ExactArgs(0),
Expand Down

0 comments on commit fa30d88

Please sign in to comment.