diff options
author | Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> | 2024-10-24 13:55:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-24 13:55:00 -0700 |
commit | 1b0631b69edbc99a9527c1d6b9a913a49e3b1523 (patch) | |
tree | dd0ea38cc13df9f6c72467306e5c997145d02b2e /share | |
parent | 65bb3a12ea190091d24d8b5c28c722426b9fe841 (diff) | |
download | spack-1b0631b69edbc99a9527c1d6b9a913a49e3b1523.tar.gz spack-1b0631b69edbc99a9527c1d6b9a913a49e3b1523.tar.bz2 spack-1b0631b69edbc99a9527c1d6b9a913a49e3b1523.tar.xz spack-1b0631b69edbc99a9527c1d6b9a913a49e3b1523.zip |
Env help: expand and refine subcommand help and descriptions (#47089)
This PR is in response to a question in the `environments` slack channel (https://spackpm.slack.com/archives/CMHK7MF51/p1729200068557219) about inadequate CLI help/documentation for one specific subcommand.
This PR uses the approach I took for the descriptions and help for `spack test` subcommands. Namely, I use the first line of the relevant docstring as the description, which is shown per subcommand in `spack env -h`, and the entire docstring as the help. I then added, where it seemed appropriate, help. I also tweaked argument docstrings to tighten them up, make consistent with similar arguments elsewhere in the command, and elaborate when it seemed important. (The only subcommand I didn't touch is `loads`.)
For example, before:
```
$ spack env update -h
usage: spack env update [-hy] env
positional arguments:
env name or directory of the environment to activate
optional arguments:
-h, --help show this help message and exit
-y, --yes-to-all assume "yes" is the answer to every confirmation request
```
After the changes in this PR:
```
$ spack env update -h
usage: spack env update [-hy] env
update the environment manifest to the latest schema format
update the environment to the latest schema format, which may not be
readable by older versions of spack
a backup copy of the manifest is retained in case there is a need to revert
this operation
positional arguments:
env name or directory of the environment
optional arguments:
-h, --help show this help message and exit
-y, --yes-to-all assume "yes" is the answer to every confirmation request
```
---------
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
Diffstat (limited to 'share')
-rw-r--r-- | share/spack/spack-completion.bash | 2 | ||||
-rw-r--r-- | share/spack/spack-completion.fish | 64 |
2 files changed, 33 insertions, 33 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 2994de4b27..10011a10b3 100644 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -1030,7 +1030,7 @@ _spack_env() { _spack_env_activate() { if $list_options then - SPACK_COMPREPLY="-h --help --sh --csh --fish --bat --pwsh --with-view -v --without-view -V -p --prompt --temp --create --envfile --keep-relative -d --dir" + SPACK_COMPREPLY="-h --help --sh --csh --fish --bat --pwsh -v --with-view -V --without-view -p --prompt --temp --create --envfile --keep-relative -d --dir" else _environments fi diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index 57533497b9..8ef18c63bd 100644 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -1472,22 +1472,22 @@ complete -c spack -n '__fish_spack_using_command edit' -s N -l namespace -r -d ' # spack env set -g __fish_spack_optspecs_spack_env h/help -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a activate -d 'set the current environment' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a deactivate -d 'deactivate any active environment in the shell' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a activate -d 'set the active environment' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a deactivate -d 'deactivate the active environment' complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a create -d 'create a new environment' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a remove -d 'remove an existing environment' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a rm -d 'remove an existing environment' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a remove -d 'remove managed environment(s)' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a rm -d 'remove managed environment(s)' complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a rename -d 'rename an existing environment' complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a mv -d 'rename an existing environment' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a list -d 'list managed environments' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a ls -d 'list managed environments' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a status -d 'print whether there is an active environment' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a st -d 'print whether there is an active environment' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a list -d 'list all managed environments' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a ls -d 'list all managed environments' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a status -d 'print active environment status' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a st -d 'print active environment status' complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a loads -d 'list modules for an installed environment '"'"'(see spack module loads)'"'"'' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a view -d 'manage a view associated with the environment' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a update -d 'update environments to the latest format' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a revert -d 'restore environments to their state before update' -complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a depfile -d 'generate a depfile from the concrete environment specs' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a view -d 'manage the environment'"'"'s view' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a update -d 'update the environment manifest to the latest schema format' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a revert -d 'restore the environment manifest to its previous format' +complete -c spack -n '__fish_spack_using_command_pos 0 env' -f -a depfile -d 'generate a depfile to exploit parallel builds across specs' complete -c spack -n '__fish_spack_using_command env' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command env' -s h -l help -d 'show this help message and exit' @@ -1506,20 +1506,20 @@ complete -c spack -n '__fish_spack_using_command env activate' -l bat -f -a shel complete -c spack -n '__fish_spack_using_command env activate' -l bat -d 'print bat commands to activate the environment' complete -c spack -n '__fish_spack_using_command env activate' -l pwsh -f -a shell complete -c spack -n '__fish_spack_using_command env activate' -l pwsh -d 'print powershell commands to activate environment' -complete -c spack -n '__fish_spack_using_command env activate' -l with-view -s v -r -f -a with_view -complete -c spack -n '__fish_spack_using_command env activate' -l with-view -s v -r -d 'set runtime environment variables for specific view' -complete -c spack -n '__fish_spack_using_command env activate' -l without-view -s V -f -a without_view -complete -c spack -n '__fish_spack_using_command env activate' -l without-view -s V -d 'do not set runtime environment variables for any view' +complete -c spack -n '__fish_spack_using_command env activate' -s v -l with-view -r -f -a with_view +complete -c spack -n '__fish_spack_using_command env activate' -s v -l with-view -r -d 'set runtime environment variables for the named view' +complete -c spack -n '__fish_spack_using_command env activate' -s V -l without-view -f -a without_view +complete -c spack -n '__fish_spack_using_command env activate' -s V -l without-view -d 'do not set runtime environment variables for any view' complete -c spack -n '__fish_spack_using_command env activate' -s p -l prompt -f -a prompt -complete -c spack -n '__fish_spack_using_command env activate' -s p -l prompt -d 'decorate the command line prompt when activating' +complete -c spack -n '__fish_spack_using_command env activate' -s p -l prompt -d 'add the active environment to the command line prompt' complete -c spack -n '__fish_spack_using_command env activate' -l temp -f -a temp -complete -c spack -n '__fish_spack_using_command env activate' -l temp -d 'create and activate an environment in a temporary directory' +complete -c spack -n '__fish_spack_using_command env activate' -l temp -d 'create and activate in a temporary directory' complete -c spack -n '__fish_spack_using_command env activate' -l create -f -a create complete -c spack -n '__fish_spack_using_command env activate' -l create -d 'create and activate the environment if it doesn'"'"'t exist' complete -c spack -n '__fish_spack_using_command env activate' -l envfile -r -f -a envfile -complete -c spack -n '__fish_spack_using_command env activate' -l envfile -r -d 'either a lockfile (must end with '"'"'.json'"'"' or '"'"'.lock'"'"') or a manifest file' +complete -c spack -n '__fish_spack_using_command env activate' -l envfile -r -d 'manifest or lock file (ends with '"'"'.json'"'"' or '"'"'.lock'"'"')' complete -c spack -n '__fish_spack_using_command env activate' -l keep-relative -f -a keep_relative -complete -c spack -n '__fish_spack_using_command env activate' -l keep-relative -d 'copy relative develop paths verbatim into the new environment when initializing from envfile' +complete -c spack -n '__fish_spack_using_command env activate' -l keep-relative -d 'copy envfile'"'"'s relative develop paths verbatim when create' complete -c spack -n '__fish_spack_using_command env activate' -s d -l dir -f -a dir complete -c spack -n '__fish_spack_using_command env activate' -s d -l dir -d 'activate environment based on the directory supplied' @@ -1546,13 +1546,13 @@ complete -c spack -n '__fish_spack_using_command env create' -s h -l help -d 'sh complete -c spack -n '__fish_spack_using_command env create' -s d -l dir -f -a dir complete -c spack -n '__fish_spack_using_command env create' -s d -l dir -d 'create an environment in a specific directory' complete -c spack -n '__fish_spack_using_command env create' -l keep-relative -f -a keep_relative -complete -c spack -n '__fish_spack_using_command env create' -l keep-relative -d 'copy relative develop paths verbatim into the new environment when initializing from envfile' +complete -c spack -n '__fish_spack_using_command env create' -l keep-relative -d 'copy envfile'"'"'s relative develop paths verbatim' complete -c spack -n '__fish_spack_using_command env create' -l without-view -f -a without_view complete -c spack -n '__fish_spack_using_command env create' -l without-view -d 'do not maintain a view for this environment' complete -c spack -n '__fish_spack_using_command env create' -l with-view -r -f -a with_view -complete -c spack -n '__fish_spack_using_command env create' -l with-view -r -d 'specify that this environment should maintain a view at the specified path (by default the view is maintained in the environment directory)' +complete -c spack -n '__fish_spack_using_command env create' -l with-view -r -d 'maintain view at WITH_VIEW (vs. environment'"'"'s directory)' complete -c spack -n '__fish_spack_using_command env create' -l include-concrete -r -f -a include_concrete -complete -c spack -n '__fish_spack_using_command env create' -l include-concrete -r -d 'name of old environment to copy specs from' +complete -c spack -n '__fish_spack_using_command env create' -l include-concrete -r -d 'copy concrete specs from INCLUDE_CONCRETE'"'"'s environment' # spack env remove set -g __fish_spack_optspecs_spack_env_remove h/help y/yes-to-all f/force @@ -1562,7 +1562,7 @@ complete -c spack -n '__fish_spack_using_command env remove' -s h -l help -d 'sh complete -c spack -n '__fish_spack_using_command env remove' -s y -l yes-to-all -f -a yes_to_all complete -c spack -n '__fish_spack_using_command env remove' -s y -l yes-to-all -d 'assume "yes" is the answer to every confirmation request' complete -c spack -n '__fish_spack_using_command env remove' -s f -l force -f -a force -complete -c spack -n '__fish_spack_using_command env remove' -s f -l force -d 'remove the environment even if it is included in another environment' +complete -c spack -n '__fish_spack_using_command env remove' -s f -l force -d 'force removal even when included in other environment(s)' # spack env rm set -g __fish_spack_optspecs_spack_env_rm h/help y/yes-to-all f/force @@ -1572,7 +1572,7 @@ complete -c spack -n '__fish_spack_using_command env rm' -s h -l help -d 'show t complete -c spack -n '__fish_spack_using_command env rm' -s y -l yes-to-all -f -a yes_to_all complete -c spack -n '__fish_spack_using_command env rm' -s y -l yes-to-all -d 'assume "yes" is the answer to every confirmation request' complete -c spack -n '__fish_spack_using_command env rm' -s f -l force -f -a force -complete -c spack -n '__fish_spack_using_command env rm' -s f -l force -d 'remove the environment even if it is included in another environment' +complete -c spack -n '__fish_spack_using_command env rm' -s f -l force -d 'force removal even when included in other environment(s)' # spack env rename set -g __fish_spack_optspecs_spack_env_rename h/help d/dir f/force @@ -1580,9 +1580,9 @@ set -g __fish_spack_optspecs_spack_env_rename h/help d/dir f/force complete -c spack -n '__fish_spack_using_command env rename' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command env rename' -s h -l help -d 'show this help message and exit' complete -c spack -n '__fish_spack_using_command env rename' -s d -l dir -f -a dir -complete -c spack -n '__fish_spack_using_command env rename' -s d -l dir -d 'the specified arguments correspond to directory paths' +complete -c spack -n '__fish_spack_using_command env rename' -s d -l dir -d 'positional arguments are environment directory paths' complete -c spack -n '__fish_spack_using_command env rename' -s f -l force -f -a force -complete -c spack -n '__fish_spack_using_command env rename' -s f -l force -d 'allow overwriting of an existing environment' +complete -c spack -n '__fish_spack_using_command env rename' -s f -l force -d 'force renaming even if overwriting an existing environment' # spack env mv set -g __fish_spack_optspecs_spack_env_mv h/help d/dir f/force @@ -1590,9 +1590,9 @@ set -g __fish_spack_optspecs_spack_env_mv h/help d/dir f/force complete -c spack -n '__fish_spack_using_command env mv' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command env mv' -s h -l help -d 'show this help message and exit' complete -c spack -n '__fish_spack_using_command env mv' -s d -l dir -f -a dir -complete -c spack -n '__fish_spack_using_command env mv' -s d -l dir -d 'the specified arguments correspond to directory paths' +complete -c spack -n '__fish_spack_using_command env mv' -s d -l dir -d 'positional arguments are environment directory paths' complete -c spack -n '__fish_spack_using_command env mv' -s f -l force -f -a force -complete -c spack -n '__fish_spack_using_command env mv' -s f -l force -d 'allow overwriting of an existing environment' +complete -c spack -n '__fish_spack_using_command env mv' -s f -l force -d 'force renaming even if overwriting an existing environment' # spack env list set -g __fish_spack_optspecs_spack_env_list h/help @@ -1659,15 +1659,15 @@ complete -c spack -n '__fish_spack_using_command_pos_remainder 0 env depfile' -f complete -c spack -n '__fish_spack_using_command env depfile' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command env depfile' -s h -l help -d 'show this help message and exit' complete -c spack -n '__fish_spack_using_command env depfile' -l make-prefix -l make-target-prefix -r -f -a make_prefix -complete -c spack -n '__fish_spack_using_command env depfile' -l make-prefix -l make-target-prefix -r -d 'prefix Makefile targets (and variables) with <TARGET>/<name>' +complete -c spack -n '__fish_spack_using_command env depfile' -l make-prefix -l make-target-prefix -r -d 'prefix Makefile targets/variables with <TARGET>/<name>,' complete -c spack -n '__fish_spack_using_command env depfile' -l make-disable-jobserver -f -a jobserver complete -c spack -n '__fish_spack_using_command env depfile' -l make-disable-jobserver -d 'disable POSIX jobserver support' complete -c spack -n '__fish_spack_using_command env depfile' -l use-buildcache -r -f -a use_buildcache -complete -c spack -n '__fish_spack_using_command env depfile' -l use-buildcache -r -d 'when using `only`, redundant build dependencies are pruned from the DAG' +complete -c spack -n '__fish_spack_using_command env depfile' -l use-buildcache -r -d 'use `only` to prune redundant build dependencies' complete -c spack -n '__fish_spack_using_command env depfile' -s o -l output -r -f -a output complete -c spack -n '__fish_spack_using_command env depfile' -s o -l output -r -d 'write the depfile to FILE rather than to stdout' complete -c spack -n '__fish_spack_using_command env depfile' -s G -l generator -r -f -a make -complete -c spack -n '__fish_spack_using_command env depfile' -s G -l generator -r -d 'specify the depfile type' +complete -c spack -n '__fish_spack_using_command env depfile' -s G -l generator -r -d 'specify the depfile type (only supports `make`)' # spack extensions set -g __fish_spack_optspecs_spack_extensions h/help l/long L/very-long d/deps p/paths s/show= |