Update Spack's Bash completion script (#10114)
* Update Spack's Bash completion script * spack mirror create options changed
This commit is contained in:
		| @@ -95,9 +95,12 @@ function _bash_completion_spack { | |||||||
| function _spack { | function _spack { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help --color -d --debug -D --pdb -k --insecure |         compgen -W "-h --help -H --all-help --color -C --config-scope | ||||||
|                     -m --mock -p --profile -P --sorted-profile --lines |                     -d --debug --pdb -e --env -D --env-dir -E --no-env | ||||||
|                     -v --verbose -s --stacktrace -V --version" -- "$cur" |                     --use-env-repo -k --insecure -l --enable-locks | ||||||
|  |                     -L --disable-locks -m --mock -p --profile | ||||||
|  |                     --sorted-profile --lines -v --verbose --stacktrace | ||||||
|  |                     -V --version --print-shell-vars" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_subcommands)" -- "$cur" |         compgen -W "$(_subcommands)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -112,6 +115,15 @@ function _spack_activate { | |||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function _spack_add { | ||||||
|  |     if $list_options | ||||||
|  |     then | ||||||
|  |         compgen -W "-h --help" -- "$cur" | ||||||
|  |     else | ||||||
|  |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
| function _spack_arch { | function _spack_arch { | ||||||
|     compgen -W "-h --help -p --platform -o --operating-system |     compgen -W "-h --help -p --platform -o --operating-system | ||||||
|                 -t --target" -- "$cur" |                 -t --target" -- "$cur" | ||||||
| @@ -127,8 +139,8 @@ function _spack_blame { | |||||||
| } | } | ||||||
|  |  | ||||||
| function _spack_bootstrap { | function _spack_bootstrap { | ||||||
|     compgen -W "-h --help -j --jobs --keep-prefix --keep-stage -n --no-checksum |     compgen -W "-h --help -j --jobs --keep-prefix --keep-stage | ||||||
|                 -v --verbose --clean --dirty --run-tests" -- "$cur" |                 -n --no-checksum -v --verbose --clean --dirty" -- "$cur" | ||||||
| } | } | ||||||
|  |  | ||||||
| function _spack_build { | function _spack_build { | ||||||
| @@ -140,6 +152,15 @@ function _spack_build { | |||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function _spack_build_env { | ||||||
|  |     if $list_options | ||||||
|  |     then | ||||||
|  |         compgen -W "-h --help --clean --dirty" -- "$cur" | ||||||
|  |     else | ||||||
|  |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
| function _spack_buildcache { | function _spack_buildcache { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
| @@ -187,7 +208,7 @@ function _spack_cd { | |||||||
|     then |     then | ||||||
|         compgen -W "-h --help -m --module-dir -r --spack-root -i --install-dir |         compgen -W "-h --help -m --module-dir -r --spack-root -i --install-dir | ||||||
|                     -p --package-dir -P --packages -s --stage-dir -S --stages |                     -p --package-dir -P --packages -s --stage-dir -S --stages | ||||||
|                     -b --build-dir" -- "$cur" |                     -b --build-dir -e --env" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_all_packages)" -- "$cur" |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -206,7 +227,7 @@ function _spack_clean { | |||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help -s --stage -d --downloads |         compgen -W "-h --help -s --stage -d --downloads | ||||||
|                     -m --misc-cache -a --all" -- "$cur" |                     -m --misc-cache -p --python-cache -a --all" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_all_packages)" -- "$cur" |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -278,19 +299,32 @@ function _spack_compilers { | |||||||
|     compgen -W "-h --help --scope" -- "$cur" |     compgen -W "-h --help --scope" -- "$cur" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function _spack_concretize { | ||||||
|  |     compgen -W "-h --help -f --force" -- "$cur" | ||||||
|  | } | ||||||
|  |  | ||||||
| function _spack_config { | function _spack_config { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help --scope" -- "$cur" |         compgen -W "-h --help --scope" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "edit get" -- "$cur" |         compgen -W "blame edit get" -- "$cur" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_config_blame { | ||||||
|  |     if $list_options | ||||||
|  |     then | ||||||
|  |         compgen -W "-h --help" -- "$cur" | ||||||
|  |     else | ||||||
|  |         compgen -W "mirrors repos modules packages config compilers" -- "$cur" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
| function _spack_config_edit { | function _spack_config_edit { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help" -- "$cur" |         compgen -W "-h --help --print-file" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "mirrors repos modules packages config compilers" -- "$cur" |         compgen -W "mirrors repos modules packages config compilers" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -366,8 +400,10 @@ function _spack_dependents { | |||||||
| function _spack_diy { | function _spack_diy { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help -i --ignore-dependencies --keep-prefix |         compgen -W "-h --help -j --jobs -d --source-path | ||||||
|                     --skip-patch -q --quiet --clean --dirty" -- "$cur" |                     -i --ignore-dependencies -n --no-checksum | ||||||
|  |                     --keep-prefix --skip-patch -q --quiet --clean | ||||||
|  |                     --dirty" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_all_packages)" -- "$cur" |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -390,19 +426,83 @@ function _spack_edit { | |||||||
| function _spack_env { | function _spack_env { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help --clean --dirty" -- "$cur" |         compgen -W "-h --help" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_all_packages)" -- "$cur" |         compgen -W "activate create deactivate list ls loads | ||||||
|  |                     remove rm status st" -- "$cur" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function _spack_env_activate { | ||||||
|  |     if $list_options | ||||||
|  |     then | ||||||
|  |         compgen -W "-h --help --sh --csh -d --dir -p --prompt" -- "$cur" | ||||||
|  |     else | ||||||
|  |         compgen -W "$(_environments)" -- "$cur" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_env_create { | ||||||
|  |     if $list_options | ||||||
|  |     then | ||||||
|  |         compgen -W "-h --help -d --dir" -- "$cur" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_env_deactivate { | ||||||
|  |     compgen -W "-h --help --sh --csh" -- "$cur" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_env_list { | ||||||
|  |     compgen -W "-h --help" -- "$cur" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_env_ls { | ||||||
|  |     # Alias to `spack env list` | ||||||
|  |     _spack_env_list | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_env_loads { | ||||||
|  |     if $list_options | ||||||
|  |     then | ||||||
|  |         compgen -W "-h --help -m --module-type --input-only -p --prefix | ||||||
|  |                     -x --exclude -r --dependencies" -- "$cur" | ||||||
|  |     else | ||||||
|  |         compgen -W "$(_environments)" -- "$cur" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_env_remove { | ||||||
|  |     if $list_options | ||||||
|  |     then | ||||||
|  |         compgen -W "-h --help -y --yes-to-all" -- "$cur" | ||||||
|  |     else | ||||||
|  |         compgen -W "$(_environments)" -- "$cur" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_env_rm { | ||||||
|  |     # Alias to `spack env remove` | ||||||
|  |     _spack_env_remove | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_env_status { | ||||||
|  |     compgen -W "-h --help" -- "$cur" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_env_st { | ||||||
|  |     # Alias to `spack env status` | ||||||
|  |     _spack_env_status | ||||||
|  | } | ||||||
|  |  | ||||||
| function _spack_extensions { | function _spack_extensions { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help -l --long -p --paths -d --deps |         compgen -W "-h --help -l --long -p --paths -d --deps | ||||||
|                     -s --show -v --view" -- "$cur" |                     -s --show -v --view" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "aspell go-bootstrap go lua matlab octave perl python r ruby |         compgen -W "aspell go-bootstrap go icedtea java jdk lua | ||||||
|  |                     matlab mofem-cephas octave perl python r ruby | ||||||
|                     rust tcl yorick" -- "$cur" |                     rust tcl yorick" -- "$cur" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
| @@ -420,10 +520,11 @@ function _spack_fetch { | |||||||
| function _spack_find { | function _spack_find { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help -s --short -p --paths -d --deps -l --long -L |         compgen -W "-h --help -s --short -p --paths -d --deps -l --long | ||||||
|                     --very-long -t --tags -f --show-flags --show-full-compiler |                     -L --very-long -t --tags -c --show-concretized | ||||||
|                     -e --explicit -E --implicit -u --unknown -m --missing |                     -f --show-flags --show-full-compiler -x --explicit | ||||||
|                     -v --variants -M --only-missing -N --namespace --start-date |                     -X --implicit -u --unknown -m --missing -v --variants | ||||||
|  |                     -M --only-missing -N --namespace --start-date | ||||||
|                     --end-date" -- "$cur" |                     --end-date" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_installed_packages)" -- "$cur" |         compgen -W "$(_installed_packages)" -- "$cur" | ||||||
| @@ -532,16 +633,34 @@ function _spack_info { | |||||||
| function _spack_install { | function _spack_install { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help --only -j --jobs --overwrite --keep-prefix |         compgen -W "-h --help --only -j --jobs -I --install-status | ||||||
|                     --keep-stage --dont-restage --use-cache --show-log-on-error |                     --overwrite --keep-prefix --keep-stage --dont-restage | ||||||
|                     --source -n --no-checksum -v --verbose --fake -f --file |                     --use-cache --no-cache --show-log-on-error --source | ||||||
|                     --clean --dirty --test --log-format --log-file |                     -n --no-checksum -v --verbose --fake --only-concrete | ||||||
|                     -y --yes-to-all" -- "$cur" |                     -f --file --clean --dirty --test --log-format --log-file | ||||||
|  |                     --cdash-upload-url -y --yes-to-all" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_all_packages)" -- "$cur" |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function _spack_license { | ||||||
|  |     if $list_options | ||||||
|  |     then | ||||||
|  |         compgen -W "-h --help" -- "$cur" | ||||||
|  |     else | ||||||
|  |         compgen -W "list-files verify" -- "$cur" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_license_list_files { | ||||||
|  |     compgen -W "-h --help" -- "$cur" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function _spack_license_verify { | ||||||
|  |     compgen -W "-h --help --root" -- "$cur" | ||||||
|  | } | ||||||
|  |  | ||||||
| function _spack_list { | function _spack_list { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
| @@ -555,7 +674,7 @@ function _spack_list { | |||||||
| function _spack_load { | function _spack_load { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help" -- "$cur" |         compgen -W "-h --help -r --dependencies" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_installed_packages)" -- "$cur" |         compgen -W "$(_installed_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -566,7 +685,7 @@ function _spack_location { | |||||||
|     then |     then | ||||||
|         compgen -W "-h --help -m --module-dir -r --spack-root -i --install-dir |         compgen -W "-h --help -m --module-dir -r --spack-root -i --install-dir | ||||||
|                     -p --package-dir -P --packages -s --stage-dir -S --stages |                     -p --package-dir -P --packages -s --stage-dir -S --stages | ||||||
|                     -b --build-dir" -- "$cur" |                     -b --build-dir -e --env" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_all_packages)" -- "$cur" |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -600,7 +719,7 @@ function _spack_mirror_create { | |||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help -d --directory -f --file |         compgen -W "-h --help -d --directory -f --file | ||||||
|                     -D --dependencies -o --one-version-per-spec" -- "$cur" |                     -D --dependencies -n --versions-per-spec" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_all_packages)" -- "$cur" |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -872,6 +991,15 @@ function _spack_reindex { | |||||||
|     compgen -W "-h --help" -- "$cur" |     compgen -W "-h --help" -- "$cur" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function _spack_remove { | ||||||
|  |     if $list_options | ||||||
|  |     then | ||||||
|  |         compgen -W "-h --help -a --all -f --force" -- "$cur" | ||||||
|  |     else | ||||||
|  |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  |  | ||||||
| function _spack_repo { | function _spack_repo { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
| @@ -925,8 +1053,8 @@ function _spack_restage { | |||||||
| function _spack_setup { | function _spack_setup { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help -i --ignore-dependencies -v --verbose |         compgen -W "-h --help -i --ignore-dependencies -n --no-checksum | ||||||
|                     --clean --dirty" -- "$cur" |                     -v --verbose --clean --dirty" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_all_packages)" -- "$cur" |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -935,8 +1063,8 @@ function _spack_setup { | |||||||
| function _spack_spec { | function _spack_spec { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help -l --long -L --very-long -y --yaml -c --cover |         compgen -W "-h --help -l --long -L --very-long -I --install-status | ||||||
|                     -N --namespaces -I --install-status -t --types" -- "$cur" |                     -y --yaml -c --cover -N --namespaces -t --types" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_all_packages)" -- "$cur" |         compgen -W "$(_all_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -964,8 +1092,8 @@ function _spack_test { | |||||||
| function _spack_uninstall { | function _spack_uninstall { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help -f --force -a --all -R --dependents |         compgen -W "-h --help -f --force -R --dependents | ||||||
|                     -y --yes-to-all" -- "$cur" |                     -y --yes-to-all -a --all" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_installed_packages)" -- "$cur" |         compgen -W "$(_installed_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -994,7 +1122,7 @@ function _spack_url { | |||||||
|     then |     then | ||||||
|         compgen -W "-h --help" -- "$cur" |         compgen -W "-h --help" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "list parse summary" -- "$cur" |         compgen -W "list parse stats summary" -- "$cur" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1011,6 +1139,10 @@ function _spack_url_parse { | |||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function _spack_url_stats { | ||||||
|  |     compgen -W "-h --help" -- "$cur" | ||||||
|  | } | ||||||
|  |  | ||||||
| function _spack_url_summary { | function _spack_url_summary { | ||||||
|     compgen -W "-h --help" -- "$cur" |     compgen -W "-h --help" -- "$cur" | ||||||
| } | } | ||||||
| @@ -1018,7 +1150,7 @@ function _spack_url_summary { | |||||||
| function _spack_use { | function _spack_use { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help" -- "$cur" |         compgen -W "-h --help -r --dependencies" -- "$cur" | ||||||
|     else |     else | ||||||
|         compgen -W "$(_installed_packages)" -- "$cur" |         compgen -W "$(_installed_packages)" -- "$cur" | ||||||
|     fi |     fi | ||||||
| @@ -1098,7 +1230,7 @@ function _spack_view_status { | |||||||
| function _spack_view_symlink { | function _spack_view_symlink { | ||||||
|     if $list_options |     if $list_options | ||||||
|     then |     then | ||||||
|         compgen -W "-h --help --ignore-conflicts" -- "$cur" |         compgen -W "-h --help -i --ignore-conflicts" -- "$cur" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1136,6 +1268,10 @@ function _tests { | |||||||
|     spack test -l |     spack test -l | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function _environments { | ||||||
|  |     spack env list | ||||||
|  | } | ||||||
|  |  | ||||||
| # Testing functions | # Testing functions | ||||||
|  |  | ||||||
| function _test_vars { | function _test_vars { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Adam J. Stewart
					Adam J. Stewart