Skip to content

Commit

Permalink
reference: add new CLI help entries
Browse files Browse the repository at this point in the history
This adds the following new CLI help entries:

* cue help environment
* cue mod publish
* cue mod tidy

After adding the requisite entries to
content/docs/reference/cli/commands.cue, the rest of the CL was
generated by running:

    go generate ./...
    _scripts/runPreprocessor.bash execute

Preview-Path: /docs/reference/cli/cue-environment
Preview-Path: /docs/reference/cli/cue-mod-tidy
Preview-Path: /docs/reference/cli/cue-mod-publish
Change-Id: Ifaed2de27007f9f322e0fbc52f3612c641c49314
Signed-off-by: Roger Peppe <[email protected]>
Dispatch-Trailer: {"type":"trybot","CL":1176651,"patchset":17,"ref":"refs/changes/51/1176651/17","targetBranch":"alpha"}
  • Loading branch information
rogpeppe authored and cueckoo committed Feb 12, 2024
1 parent d30cc20 commit 94b71d9
Show file tree
Hide file tree
Showing 13 changed files with 348 additions and 22 deletions.
47 changes: 25 additions & 22 deletions content/docs/reference/cli/commands.cue
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,29 @@ cue: {
execCmd: "cue help"
title: "cue"
}
version: _
cmd: _
commands: _
completion: _
def: _
eval: _
export: _
filetypes: _
fix: _
flags: _
fmt: _
get: _
"get go": _
help: _
import: _
injection: _
inputs: _
mod: _
"mod init": _
trim: _
version: _
vet: _
version: _
cmd: _
commands: _
completion: _
def: _
environment: _
eval: _
export: _
filetypes: _
fix: _
flags: _
fmt: _
get: _
"get go": _
help: _
import: _
injection: _
inputs: _
mod: _
"mod init": _
"mod publish": _
"mod tidy": _
trim: _
version: _
vet: _
}
10 changes: 10 additions & 0 deletions content/docs/reference/cli/cue-environment/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
WARNING: "Code generated site_tool.cue; DO NOT EDIT."
title: "cue environment"
tags:
- cue command
---

{{{with script "en" "cue cli help text"}}}
cue help environment
{{{end}}}
83 changes: 83 additions & 0 deletions content/docs/reference/cli/cue-environment/gen_cache.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package site
{
content: {
docs: {
reference: {
cli: {
"cue-environment": {
page: {
cache: {
multi_step: {
"IEJR2KECMQK9DLHKR9I5T0DO48271MD23AHA1HCOA0F3JQGDLHS0====": [{
doc: ""
cmd: "cue help environment"
exitCode: 0
output: """
The cue command consults environment variables for configuration.
If an environment variable is unset or empty, it uses a sensible default
setting.
\tCUE_CONFIG_DIR
\t\tThe directory where the cue command keeps configuration and state files.
\t\tThis defaults to a directory for user-specific configuration data, such as:
\t\t\t"$XDG_CONFIG_HOME/cue" or "$HOME/.config/cue" on Linux
\t\t\t"$HOME/Library/Application Support" on MacOS
\t\t\t"%AppData%/cue" on Windows
\tCUE_REGISTRY
\t\tA comma-separated list specifying which registry to use for
\t\tdownloading and publishing modules. A registry is specifed
\t\tas follows:
\t\t\t[modulePrefix=]hostname[:port][/repoPrefix][+insecure]
\t\tThe optional modulePrefix specifes that all modules with the
\t\tgiven prefix wil use the associated registry. If there are
\t\tmultiple registries with a prefix, the longest matching prefix wins.
\t\tThe hostname holds the OCI registry host (in square brackets if it's
\t\tan IPv6 address). The repoPrefix holds a prefix to use in front
\t\tof all repositories in the registry. If there's a "+insecure"
\t\tsuffix, it specifies that an insecure HTTP connection should be
\t\tused to this registry; otherwise the default is secure except
\t\tfor localhost addresses.
\t\tFor example, given:
\t\t\tCUE_REGISTRY=public-registry.com,github.com/acmecorp=registry.acme.com:6000/modules
\t\tthe module named github.com/foo/bar will be fetched
\t\tfrom public-registry.com; a module named
\t\tgithub.com/acmecorp/somemodule will be fetched from the
\t\tmodules/github.com/acmecorp/somemodule repository in the host
\t\tregistry.acme.com at port 6000.
\t\tRequires that CUE_EXPERIMENT=modules is enabled.
\tCUE_MODCACHE
\t\tThe directory where the cue command will store downloaded
\t\tmodules.
\t\tRequires that CUE_EXPERIMENT=modules is enabled.
\tCUE_EXPERIMENT
\t\tComma-separated list of experiments to enable or disable.
\t\tThe list of available experiments may change arbitrarily over
\t\ttime. See exp.go in package cuelang.org/go/internal/cueexperiment for
\t\tcurrently valid values.
\t\tWarning: This variable is provided for the development and
\t\ttesting of the cue commands itself. Use beyond that purpose
\t\tis unsupported.
"""
}]
}
}
}
}
}
}
}
}
}
4 changes: 4 additions & 0 deletions content/docs/reference/cli/cue-environment/page.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Code generated site_tool.cue; DO NOT EDIT.
package site

{"content":{"docs":{"reference":{"cli":{"cue-environment":{}}}}}}
10 changes: 10 additions & 0 deletions content/docs/reference/cli/cue-mod-publish/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
WARNING: "Code generated site_tool.cue; DO NOT EDIT."
title: "cue mod publish"
tags:
- cue command
---

{{{with script "en" "cue cli help text"}}}
cue help mod publish
{{{end}}}
42 changes: 42 additions & 0 deletions content/docs/reference/cli/cue-mod-publish/gen_cache.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package site
{
content: {
docs: {
reference: {
cli: {
"cue-mod-publish": {
page: {
cache: {
multi_step: {
"MPFLQUKETE49RQ507K6LB74V4KD91BUVR7C90DFGGEHJJPGS8FA0====": [{
doc: ""
cmd: "cue help mod publish"
exitCode: 0
output: """
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.
Usage:
cue mod publish <version> [flags]
Global Flags:
-E, --all-errors print all available errors
-i, --ignore proceed in the presence of errors
-s, --simplify simplify output
--strict report errors for lossy mappings
--trace trace computation
-v, --verbose print information about progress
"""
}]
}
}
}
}
}
}
}
}
}
4 changes: 4 additions & 0 deletions content/docs/reference/cli/cue-mod-publish/page.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Code generated site_tool.cue; DO NOT EDIT.
package site

{"content":{"docs":{"reference":{"cli":{"cue-mod-publish":{}}}}}}
10 changes: 10 additions & 0 deletions content/docs/reference/cli/cue-mod-tidy/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
WARNING: "Code generated site_tool.cue; DO NOT EDIT."
title: "cue mod tidy"
tags:
- cue command
---

{{{with script "en" "cue cli help text"}}}
cue help mod tidy
{{{end}}}
41 changes: 41 additions & 0 deletions content/docs/reference/cli/cue-mod-tidy/gen_cache.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package site
{
content: {
docs: {
reference: {
cli: {
"cue-mod-tidy": {
page: {
cache: {
multi_step: {
"KAOUUK8P8ATM22AMFKIKEDHO8GAL5HUNTRCHMHTR8O0OOLAOPKK0====": [{
doc: ""
cmd: "cue help mod tidy"
exitCode: 0
output: """
WARNING: THIS COMMAND IS EXPERIMENTAL.
Currently this command must be run in the module's root directory.
Usage:
cue mod tidy [flags]
Global Flags:
-E, --all-errors print all available errors
-i, --ignore proceed in the presence of errors
-s, --simplify simplify output
--strict report errors for lossy mappings
--trace trace computation
-v, --verbose print information about progress
"""
}]
}
}
}
}
}
}
}
}
}
4 changes: 4 additions & 0 deletions content/docs/reference/cli/cue-mod-tidy/page.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Code generated site_tool.cue; DO NOT EDIT.
package site

{"content":{"docs":{"reference":{"cli":{"cue-mod-tidy":{}}}}}}
66 changes: 66 additions & 0 deletions hugo/content/en/docs/reference/cli/cue-environment/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
WARNING: "Code generated site_tool.cue; DO NOT EDIT."
title: "cue environment"
tags:
- cue command
---

```text { title="TERMINAL" codeToCopy="Y3VlIGhlbHAgZW52aXJvbm1lbnQK" }
$ cue help environment
The cue command consults environment variables for configuration.
If an environment variable is unset or empty, it uses a sensible default
setting.
CUE_CONFIG_DIR
The directory where the cue command keeps configuration and state files.
This defaults to a directory for user-specific configuration data, such as:
"$XDG_CONFIG_HOME/cue" or "$HOME/.config/cue" on Linux
"$HOME/Library/Application Support" on MacOS
"%AppData%/cue" on Windows
CUE_REGISTRY
A comma-separated list specifying which registry to use for
downloading and publishing modules. A registry is specifed
as follows:
[modulePrefix=]hostname[:port][/repoPrefix][+insecure]
The optional modulePrefix specifes that all modules with the
given prefix wil use the associated registry. If there are
multiple registries with a prefix, the longest matching prefix wins.
The hostname holds the OCI registry host (in square brackets if it's
an IPv6 address). The repoPrefix holds a prefix to use in front
of all repositories in the registry. If there's a "+insecure"
suffix, it specifies that an insecure HTTP connection should be
used to this registry; otherwise the default is secure except
for localhost addresses.
For example, given:
CUE_REGISTRY=public-registry.com,github.com/acmecorp=registry.acme.com:6000/modules
the module named github.com/foo/bar will be fetched
from public-registry.com; a module named
github.com/acmecorp/somemodule will be fetched from the
modules/github.com/acmecorp/somemodule repository in the host
registry.acme.com at port 6000.
Requires that CUE_EXPERIMENT=modules is enabled.
CUE_MODCACHE
The directory where the cue command will store downloaded
modules.
Requires that CUE_EXPERIMENT=modules is enabled.
CUE_EXPERIMENT
Comma-separated list of experiments to enable or disable.
The list of available experiments may change arbitrarily over
time. See exp.go in package cuelang.org/go/internal/cueexperiment for
currently valid values.
Warning: This variable is provided for the development and
testing of the cue commands itself. Use beyond that purpose
is unsupported.
```
25 changes: 25 additions & 0 deletions hugo/content/en/docs/reference/cli/cue-mod-publish/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
WARNING: "Code generated site_tool.cue; DO NOT EDIT."
title: "cue mod publish"
tags:
- cue command
---

```text { title="TERMINAL" codeToCopy="Y3VlIGhlbHAgbW9kIHB1Ymxpc2gK" }
$ cue help mod publish
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.
Usage:
cue mod publish <version> [flags]
Global Flags:
-E, --all-errors print all available errors
-i, --ignore proceed in the presence of errors
-s, --simplify simplify output
--strict report errors for lossy mappings
--trace trace computation
-v, --verbose print information about progress
```
24 changes: 24 additions & 0 deletions hugo/content/en/docs/reference/cli/cue-mod-tidy/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
WARNING: "Code generated site_tool.cue; DO NOT EDIT."
title: "cue mod tidy"
tags:
- cue command
---

```text { title="TERMINAL" codeToCopy="Y3VlIGhlbHAgbW9kIHRpZHkK" }
$ cue help mod tidy
WARNING: THIS COMMAND IS EXPERIMENTAL.
Currently this command must be run in the module's root directory.
Usage:
cue mod tidy [flags]
Global Flags:
-E, --all-errors print all available errors
-i, --ignore proceed in the presence of errors
-s, --simplify simplify output
--strict report errors for lossy mappings
--trace trace computation
-v, --verbose print information about progress
```

0 comments on commit 94b71d9

Please sign in to comment.