Add concretise and containerise aliases for our UK users

From a user:

> Aargh.
> ```
> ==> Error: concretise is not a recognized Spack command or extension command; check with `spack commands`.
> ```

To make things easier for our friends in the UK, this adds `concretise` and
`containerise` aliases for the `spack concretize` and `spack containerize` commands.

- [x] add aliases
- [x] update completions
This commit is contained in:
Todd Gamblin 2023-08-17 11:57:48 -07:00
parent ae5511afd6
commit a3ecd7efed
3 changed files with 40 additions and 2 deletions

View File

@ -51,7 +51,7 @@
stat_names = pstats.Stats.sort_arg_dict_default
#: top-level aliases for Spack commands
aliases = {"rm": "remove"}
aliases = {"concretise": "concretize", "containerise": "containerize", "rm": "remove"}
#: help levels in order of detail (i.e., number of commands shown)
levels = ["short", "long"]

View File

@ -337,7 +337,7 @@ _spack() {
then
SPACK_COMPREPLY="-h --help -H --all-help --color -c --config -C --config-scope -d --debug --timestamp --pdb -e --env -D --env-dir -E --no-env --use-env-repo -k --insecure -l --enable-locks -L --disable-locks -m --mock -b --bootstrap -p --profile --sorted-profile --lines -v --verbose --stacktrace --backtrace -V --version --print-shell-vars"
else
SPACK_COMPREPLY="add arch audit blame bootstrap build-env buildcache cd change checksum ci clean clone commands compiler compilers concretize config containerize create debug dependencies dependents deprecate dev-build develop diff docs edit env extensions external fetch find gc gpg graph help info install license list load location log-parse maintainers make-installer mark mirror module patch pkg providers pydoc python reindex remove rm repo resource restage solve spec stage style tags test test-env tutorial undevelop uninstall unit-test unload url verify versions view"
SPACK_COMPREPLY="add arch audit blame bootstrap build-env buildcache cd change checksum ci clean clone commands compiler compilers concretize concretise config containerize containerise create debug dependencies dependents deprecate dev-build develop diff docs edit env extensions external fetch find gc gpg graph help info install license list load location log-parse maintainers make-installer mark mirror module patch pkg providers pydoc python reindex remove rm repo resource restage solve spec stage style tags test test-env tutorial undevelop uninstall unit-test unload url verify versions view"
fi
}
@ -737,6 +737,10 @@ _spack_concretize() {
SPACK_COMPREPLY="-h --help -f --force --test -q --quiet -U --fresh --reuse --reuse-deps -j --jobs"
}
_spack_concretise() {
SPACK_COMPREPLY="-h --help -f --force --test -q --quiet -U --fresh --reuse --reuse-deps -j --jobs"
}
_spack_config() {
if $list_options
then
@ -830,6 +834,10 @@ _spack_containerize() {
SPACK_COMPREPLY="-h --help --list-os --last-stage"
}
_spack_containerise() {
SPACK_COMPREPLY="-h --help --list-os --last-stage"
}
_spack_create() {
if $list_options
then

View File

@ -365,8 +365,10 @@ complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a commands -d 'list
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a compiler -d 'manage compilers'
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a compilers -d 'list available compilers'
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a concretize -d 'concretize an environment and write a lockfile'
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a concretise -d 'concretize an environment and write a lockfile'
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a config -d 'get and set configuration options'
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a containerize -d 'creates recipes to build images for different container runtimes'
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a containerise -d 'creates recipes to build images for different container runtimes'
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a create -d 'create a new package file'
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a debug -d 'debugging commands for troubleshooting Spack'
complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a dependencies -d 'show dependencies of a package'
@ -1100,6 +1102,25 @@ complete -c spack -n '__fish_spack_using_command concretize' -l reuse-deps -d 'r
complete -c spack -n '__fish_spack_using_command concretize' -s j -l jobs -r -f -a jobs
complete -c spack -n '__fish_spack_using_command concretize' -s j -l jobs -r -d 'explicitly set number of parallel jobs'
# spack concretise
set -g __fish_spack_optspecs_spack_concretise h/help f/force test= q/quiet U/fresh reuse reuse-deps j/jobs=
complete -c spack -n '__fish_spack_using_command concretise' -s h -l help -f -a help
complete -c spack -n '__fish_spack_using_command concretise' -s h -l help -d 'show this help message and exit'
complete -c spack -n '__fish_spack_using_command concretise' -s f -l force -f -a force
complete -c spack -n '__fish_spack_using_command concretise' -s f -l force -d 're-concretize even if already concretized'
complete -c spack -n '__fish_spack_using_command concretise' -l test -r -f -a 'root all'
complete -c spack -n '__fish_spack_using_command concretise' -l test -r -d 'concretize with test dependencies of only root packages or all packages'
complete -c spack -n '__fish_spack_using_command concretise' -s q -l quiet -f -a quiet
complete -c spack -n '__fish_spack_using_command concretise' -s q -l quiet -d 'don\'t print concretized specs'
complete -c spack -n '__fish_spack_using_command concretise' -s U -l fresh -f -a concretizer_reuse
complete -c spack -n '__fish_spack_using_command concretise' -s U -l fresh -d 'do not reuse installed deps; build newest configuration'
complete -c spack -n '__fish_spack_using_command concretise' -l reuse -f -a concretizer_reuse
complete -c spack -n '__fish_spack_using_command concretise' -l reuse -d 'reuse installed packages/buildcaches when possible'
complete -c spack -n '__fish_spack_using_command concretise' -l reuse-deps -f -a concretizer_reuse
complete -c spack -n '__fish_spack_using_command concretise' -l reuse-deps -d 'reuse installed dependencies only'
complete -c spack -n '__fish_spack_using_command concretise' -s j -l jobs -r -f -a jobs
complete -c spack -n '__fish_spack_using_command concretise' -s j -l jobs -r -d 'explicitly set number of parallel jobs'
# spack config
set -g __fish_spack_optspecs_spack_config h/help scope=
complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a get -d 'print configuration values'
@ -1194,6 +1215,15 @@ complete -c spack -n '__fish_spack_using_command containerize' -l list-os -d 'li
complete -c spack -n '__fish_spack_using_command containerize' -l last-stage -r -f -a 'bootstrap build final'
complete -c spack -n '__fish_spack_using_command containerize' -l last-stage -r -d 'last stage in the container recipe'
# spack containerise
set -g __fish_spack_optspecs_spack_containerise h/help list-os last-stage=
complete -c spack -n '__fish_spack_using_command containerise' -s h -l help -f -a help
complete -c spack -n '__fish_spack_using_command containerise' -s h -l help -d 'show this help message and exit'
complete -c spack -n '__fish_spack_using_command containerise' -l list-os -f -a list_os
complete -c spack -n '__fish_spack_using_command containerise' -l list-os -d 'list all the OS that can be used in the bootstrap phase and exit'
complete -c spack -n '__fish_spack_using_command containerise' -l last-stage -r -f -a 'bootstrap build final'
complete -c spack -n '__fish_spack_using_command containerise' -l last-stage -r -d 'last stage in the container recipe'
# spack create
set -g __fish_spack_optspecs_spack_create h/help keep-stage n/name= t/template= r/repo= N/namespace= f/force skip-editor b/batch