2019-12-31 14:36:56 +08:00
|
|
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2017-02-07 04:34:35 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2017-02-07 04:34:35 +08:00
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
# NOTE: spack-completion.bash is auto-generated by:
|
|
|
|
#
|
|
|
|
# $ spack commands --aliases --format=bash
|
|
|
|
# --header=bash/spack-completion.in --update=spack-completion.bash
|
|
|
|
#
|
|
|
|
# Please do not manually modify this file.
|
|
|
|
|
|
|
|
|
|
|
|
# The following global variables are set by Bash programmable completion:
|
|
|
|
#
|
|
|
|
# COMP_CWORD: An index into ${COMP_WORDS} of the word containing the
|
|
|
|
# current cursor position
|
|
|
|
# COMP_KEY: The key (or final key of a key sequence) used to invoke
|
|
|
|
# the current completion function
|
|
|
|
# COMP_LINE: The current command line
|
|
|
|
# COMP_POINT: The index of the current cursor position relative to the
|
|
|
|
# beginning of the current command
|
|
|
|
# COMP_TYPE: Set to an integer value corresponding to the type of
|
|
|
|
# completion attempted that caused a completion function
|
|
|
|
# to be called
|
|
|
|
# COMP_WORDBREAKS: The set of characters that the readline library treats
|
|
|
|
# as word separators when performing word completion
|
|
|
|
# COMP_WORDS: An array variable consisting of the individual words in
|
|
|
|
# the current command line
|
|
|
|
#
|
|
|
|
# The following global variable is used by Bash programmable completion:
|
|
|
|
#
|
|
|
|
# COMPREPLY: An array variable from which bash reads the possible
|
|
|
|
# completions generated by a shell function invoked by the
|
|
|
|
# programmable completion facility
|
|
|
|
#
|
|
|
|
# See `man bash` for more details.
|
2017-02-07 04:34:35 +08:00
|
|
|
|
2020-12-19 09:26:15 +08:00
|
|
|
if test -n "${ZSH_VERSION:-}" ; then
|
|
|
|
if [[ "$(emulate)" = zsh ]] ; then
|
|
|
|
# ensure base completion support is enabled, ignore insecure directories
|
|
|
|
autoload -U +X compinit && compinit -i
|
|
|
|
# ensure bash compatible completion support is enabled
|
|
|
|
autoload -U +X bashcompinit && bashcompinit
|
|
|
|
emulate sh -c "source '$0:A'"
|
|
|
|
return # stop interpreting file
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-02-07 04:34:35 +08:00
|
|
|
# Bash programmable completion for Spack
|
2020-01-06 15:35:23 +08:00
|
|
|
_bash_completion_spack() {
|
2017-02-07 04:34:35 +08:00
|
|
|
# In all following examples, let the cursor be denoted by brackets, i.e. []
|
|
|
|
|
|
|
|
# For our purposes, flags should not affect tab completion. For instance,
|
|
|
|
# `spack install []` and `spack -d install --jobs 8 []` should both give the same
|
|
|
|
# possible completions. Therefore, we need to ignore any flags in COMP_WORDS.
|
|
|
|
local COMP_WORDS_NO_FLAGS=()
|
|
|
|
local index=0
|
|
|
|
while [[ "$index" -lt "$COMP_CWORD" ]]
|
|
|
|
do
|
|
|
|
if [[ "${COMP_WORDS[$index]}" == [a-z]* ]]
|
|
|
|
then
|
|
|
|
COMP_WORDS_NO_FLAGS+=("${COMP_WORDS[$index]}")
|
|
|
|
fi
|
|
|
|
let index++
|
|
|
|
done
|
|
|
|
|
|
|
|
# Options will be listed by a subfunction named after non-flag arguments.
|
|
|
|
# For example, `spack -d install []` will call _spack_install
|
|
|
|
# and `spack compiler add []` will call _spack_compiler_add
|
|
|
|
local subfunction=$(IFS='_'; echo "_${COMP_WORDS_NO_FLAGS[*]}")
|
2020-01-07 13:18:14 +08:00
|
|
|
|
2017-05-03 21:12:33 +08:00
|
|
|
# Translate dashes to underscores, as dashes are not permitted in
|
2017-11-05 08:08:04 +08:00
|
|
|
# compatibility mode. See https://github.com/spack/spack/pull/4079
|
2017-05-03 21:12:33 +08:00
|
|
|
subfunction=${subfunction//-/_}
|
2017-02-07 04:34:35 +08:00
|
|
|
|
|
|
|
# However, the word containing the current cursor position needs to be
|
|
|
|
# added regardless of whether or not it is a flag. This allows us to
|
|
|
|
# complete something like `spack install --keep-st[]`
|
|
|
|
COMP_WORDS_NO_FLAGS+=("${COMP_WORDS[$COMP_CWORD]}")
|
|
|
|
|
|
|
|
# Since we have removed all words after COMP_CWORD, we can safely assume
|
|
|
|
# that COMP_CWORD_NO_FLAGS is simply the index of the last element
|
2020-01-06 15:35:23 +08:00
|
|
|
local COMP_CWORD_NO_FLAGS=$((${#COMP_WORDS_NO_FLAGS[@]} - 1))
|
2017-02-07 04:34:35 +08:00
|
|
|
|
|
|
|
# There is no guarantee that the cursor is at the end of the command line
|
|
|
|
# when tab completion is envoked. For example, in the following situation:
|
|
|
|
# `spack -d [] install`
|
|
|
|
# if the user presses the TAB key, a list of valid flags should be listed.
|
|
|
|
# Note that we cannot simply ignore everything after the cursor. In the
|
|
|
|
# previous scenario, the user should expect to see a list of flags, but
|
|
|
|
# not of other subcommands. Obviously, `spack -d list install` would be
|
|
|
|
# invalid syntax. To accomplish this, we use the variable list_options
|
|
|
|
# which is true if the current word starts with '-' or if the cursor is
|
|
|
|
# not at the end of the line.
|
|
|
|
local list_options=false
|
2020-01-06 15:35:23 +08:00
|
|
|
if [[ "${COMP_WORDS[$COMP_CWORD]}" == -* || "$COMP_POINT" -ne "${#COMP_LINE}" ]]
|
2017-02-07 04:34:35 +08:00
|
|
|
then
|
|
|
|
list_options=true
|
|
|
|
fi
|
|
|
|
|
|
|
|
# In general, when envoking tab completion, the user is not expecting to
|
|
|
|
# see optional flags mixed in with subcommands or package names. Tab
|
|
|
|
# completion is used by those who are either lazy or just bad at spelling.
|
|
|
|
# If someone doesn't remember what flag to use, seeing single letter flags
|
|
|
|
# in their results won't help them, and they should instead consult the
|
|
|
|
# documentation. However, if the user explicitly declares that they are
|
|
|
|
# looking for a flag, we can certainly help them out.
|
|
|
|
# `spack install -[]`
|
|
|
|
# and
|
|
|
|
# `spack install --[]`
|
|
|
|
# should list all flags and long flags, respectively. Furthermore, if a
|
|
|
|
# subcommand has no non-flag completions, such as `spack arch []`, it
|
|
|
|
# should list flag completions.
|
|
|
|
|
|
|
|
local cur=${COMP_WORDS_NO_FLAGS[$COMP_CWORD_NO_FLAGS]}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
# If the cursor is in the middle of the line, like:
|
|
|
|
# `spack -d [] install`
|
|
|
|
# COMP_WORDS will not contain the empty character, so we have to add it.
|
|
|
|
if [[ "${COMP_LINE:$COMP_POINT:1}" == " " ]]
|
|
|
|
then
|
|
|
|
cur=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Uncomment this line to enable logging
|
|
|
|
#_test_vars >> temp
|
2017-02-07 04:34:35 +08:00
|
|
|
|
|
|
|
# Make sure function exists before calling it
|
2020-12-19 09:26:15 +08:00
|
|
|
local rgx #this dance is necessary to cover bash and zsh regex
|
|
|
|
rgx="$subfunction.*function.* "
|
|
|
|
if [[ "$(type $subfunction 2>&1)" =~ $rgx ]]
|
2017-02-07 04:34:35 +08:00
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
$subfunction
|
|
|
|
COMPREPLY=($(compgen -W "$SPACK_COMPREPLY" -- "$cur"))
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Helper functions for subcommands
|
|
|
|
# Results of each query are cached via environment variables
|
|
|
|
|
|
|
|
_subcommands() {
|
|
|
|
if [[ -z "${SPACK_SUBCOMMANDS:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_SUBCOMMANDS="$(spack commands)"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_SUBCOMMANDS"
|
|
|
|
}
|
|
|
|
|
|
|
|
_all_packages() {
|
|
|
|
if [[ -z "${SPACK_ALL_PACKAGES:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_ALL_PACKAGES="$(spack list)"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_ALL_PACKAGES"
|
|
|
|
}
|
|
|
|
|
|
|
|
_all_resource_hashes() {
|
|
|
|
if [[ -z "${SPACK_ALL_RESOURCES_HASHES:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_ALL_RESOURCE_HASHES="$(spack resource list --only-hashes)"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_ALL_RESOURCE_HASHES"
|
|
|
|
}
|
|
|
|
|
|
|
|
_installed_packages() {
|
|
|
|
if [[ -z "${SPACK_INSTALLED_PACKAGES:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_INSTALLED_PACKAGES="$(spack --color=never find --no-groups)"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_INSTALLED_PACKAGES"
|
|
|
|
}
|
|
|
|
|
|
|
|
_installed_compilers() {
|
|
|
|
if [[ -z "${SPACK_INSTALLED_COMPILERS:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_INSTALLED_COMPILERS="$(spack compilers | egrep -v "^(-|=)")"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_INSTALLED_COMPILERS"
|
|
|
|
}
|
|
|
|
|
|
|
|
_providers() {
|
|
|
|
if [[ -z "${SPACK_PROVIDERS:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_PROVIDERS="$(spack providers)"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_PROVIDERS"
|
|
|
|
}
|
|
|
|
|
|
|
|
_mirrors() {
|
|
|
|
if [[ -z "${SPACK_MIRRORS:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_MIRRORS="$(spack mirror list | awk '{print $1}')"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_MIRRORS"
|
|
|
|
}
|
|
|
|
|
|
|
|
_repos() {
|
|
|
|
if [[ -z "${SPACK_REPOS:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_REPOS="$(spack repo list | awk '{print $1}')"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_REPOS"
|
|
|
|
}
|
|
|
|
|
|
|
|
_tests() {
|
|
|
|
if [[ -z "${SPACK_TESTS:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_TESTS="$(spack test -l)"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_TESTS"
|
|
|
|
}
|
|
|
|
|
|
|
|
_environments() {
|
|
|
|
if [[ -z "${SPACK_ENVIRONMENTS:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_ENVIRONMENTS="$(spack env list)"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_ENVIRONMENTS"
|
|
|
|
}
|
|
|
|
|
|
|
|
_keys() {
|
|
|
|
if [[ -z "${SPACK_KEYS:-}" ]]
|
|
|
|
then
|
|
|
|
SPACK_KEYS="$(spack gpg list)"
|
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_KEYS"
|
|
|
|
}
|
|
|
|
|
|
|
|
_config_sections() {
|
|
|
|
if [[ -z "${SPACK_CONFIG_SECTIONS:-}" ]]
|
|
|
|
then
|
2020-01-25 09:28:20 +08:00
|
|
|
SPACK_CONFIG_SECTIONS="$(spack config list)"
|
2020-01-06 15:35:23 +08:00
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_CONFIG_SECTIONS"
|
|
|
|
}
|
|
|
|
|
|
|
|
_extensions() {
|
|
|
|
if [[ -z "${SPACK_EXTENSIONS:-}" ]]
|
|
|
|
then
|
2020-02-18 07:41:48 +08:00
|
|
|
SPACK_EXTENSIONS="$(spack extensions)"
|
2020-01-06 15:35:23 +08:00
|
|
|
fi
|
|
|
|
SPACK_COMPREPLY="$SPACK_EXTENSIONS"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Testing functions
|
|
|
|
|
|
|
|
# Function for unit testing tab completion
|
|
|
|
# Syntax: _spack_completions spack install py-
|
|
|
|
_spack_completions() {
|
|
|
|
local COMP_CWORD COMP_KEY COMP_LINE COMP_POINT COMP_TYPE COMP_WORDS COMPREPLY
|
|
|
|
|
|
|
|
# Set each variable the way bash would
|
|
|
|
COMP_LINE="$*"
|
|
|
|
COMP_POINT=${#COMP_LINE}
|
|
|
|
COMP_WORDS=("$@")
|
|
|
|
if [[ ${COMP_LINE: -1} == ' ' ]]
|
|
|
|
then
|
|
|
|
COMP_WORDS+=('')
|
|
|
|
fi
|
|
|
|
COMP_CWORD=$((${#COMP_WORDS[@]} - 1))
|
|
|
|
COMP_KEY=9 # ASCII 09: Horizontal Tab
|
|
|
|
COMP_TYPE=64 # ASCII 64: '@', to list completions if the word is not unmodified
|
|
|
|
|
|
|
|
# Run Spack's tab completion function
|
|
|
|
_bash_completion_spack
|
|
|
|
|
|
|
|
# Return the result
|
|
|
|
echo "${COMPREPLY[@]:-}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Log the environment variables used
|
|
|
|
# Syntax: _test_vars >> temp
|
|
|
|
_test_vars() {
|
|
|
|
echo "-----------------------------------------------------"
|
|
|
|
echo "Variables set by bash:"
|
|
|
|
echo
|
|
|
|
echo "COMP_LINE: '$COMP_LINE'"
|
|
|
|
echo "# COMP_LINE: '${#COMP_LINE}'"
|
|
|
|
echo "COMP_WORDS: $(_pretty_print COMP_WORDS[@])"
|
|
|
|
echo "# COMP_WORDS: '${#COMP_WORDS[@]}'"
|
|
|
|
echo "COMP_CWORD: '$COMP_CWORD'"
|
|
|
|
echo "COMP_KEY: '$COMP_KEY'"
|
|
|
|
echo "COMP_POINT: '$COMP_POINT'"
|
|
|
|
echo "COMP_TYPE: '$COMP_TYPE'"
|
|
|
|
echo "COMP_WORDBREAKS: '$COMP_WORDBREAKS'"
|
|
|
|
echo
|
|
|
|
echo "Intermediate variables:"
|
|
|
|
echo
|
|
|
|
echo "COMP_WORDS_NO_FLAGS: $(_pretty_print COMP_WORDS_NO_FLAGS[@])"
|
|
|
|
echo "# COMP_WORDS_NO_FLAGS: '${#COMP_WORDS_NO_FLAGS[@]}'"
|
|
|
|
echo "COMP_CWORD_NO_FLAGS: '$COMP_CWORD_NO_FLAGS'"
|
|
|
|
echo
|
|
|
|
echo "Subfunction: '$subfunction'"
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
echo "List options: 'True'"
|
|
|
|
else
|
|
|
|
echo "List options: 'False'"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
2020-01-06 15:35:23 +08:00
|
|
|
echo "Current word: '$cur'"
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
# Pretty-prints one or more arrays
|
|
|
|
# Syntax: _pretty_print array1[@] ...
|
|
|
|
_pretty_print() {
|
|
|
|
for arg in $@
|
|
|
|
do
|
|
|
|
local array=("${!arg}")
|
|
|
|
printf "$arg: ["
|
|
|
|
printf "'%s'" "${array[0]}"
|
|
|
|
printf ", '%s'" "${array[@]:1}"
|
|
|
|
echo "]"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
complete -o bashdefault -o default -F _bash_completion_spack spack
|
|
|
|
|
2020-05-14 02:02:38 +08:00
|
|
|
# Completion for spacktivate
|
|
|
|
complete -o bashdefault -o default -F _bash_completion_spack spacktivate
|
|
|
|
|
|
|
|
_spacktivate() {
|
|
|
|
_spack_env_activate
|
|
|
|
}
|
|
|
|
|
2017-02-07 04:34:35 +08:00
|
|
|
# Spack commands
|
2020-01-06 15:35:23 +08:00
|
|
|
#
|
|
|
|
# Everything below here is auto-generated.
|
2017-02-07 04:34:35 +08:00
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -H --all-help --color -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 -p --profile --sorted-profile --lines -v --verbose --stacktrace -V --version --print-shell-vars"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
add mypy to style checks; rename `spack flake8` to `spack style` (#20384)
I lost my mind a bit after getting the completion stuff working and
decided to get Mypy working for spack as well. This adds a
`.mypy.ini` that checks all of the spack and llnl modules, though
not yet packages, and fixes all of the identified missing types and
type issues for the spack library.
In addition to these changes, this includes:
* rename `spack flake8` to `spack style`
Aliases flake8 to style, and just runs flake8 as before, but with
a warning. The style command runs both `flake8` and `mypy`,
in sequence. Added --no-<tool> options to turn off one or the
other, they are on by default. Fixed two issues caught by the tools.
* stub typing module for python2.x
We don't support typing in Spack for python 2.x. To allow 2.x to
support `import typing` and `from typing import ...` without a
try/except dance to support old versions, this adds a stub module
*just* for python 2.x. Doing it this way means we can only reliably
use all type hints in python3.7+, and mypi.ini has been updated to
reflect that.
* add non-default black check to spack style
This is a first step to requiring black. It doesn't enforce it by
default, but it will check it if requested. Currently enforcing the
line length of 79 since that's what flake8 requires, but it's a bit odd
for a black formatted project to be quite that narrow. All settings are
in the style command since spack has no pyproject.toml and I don't
want to add one until more discussion happens. Also re-format
`style.py` since it no longer passed the black style check
with the new length.
* use style check in github action
Update the style and docs action to use `spack style`, adding in mypy
and black to the action even if it isn't running black right now.
2020-12-23 13:39:10 +08:00
|
|
|
SPACK_COMPREPLY="activate add arch blame build-env buildcache cd checksum ci clean clone commands compiler compilers concretize config containerize create deactivate debug dependencies dependents deprecate dev-build develop docs edit env extensions external fetch find flake8 gc gpg graph help info install license list load location log-parse maintainers mark mirror module patch pkg providers pydoc python reindex remove rm repo resource restage setup solve spec stage style test test-env tutorial undevelop uninstall unit-test unload url verify versions view"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_activate() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -f --force -v --view"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_add() {
|
2018-12-18 03:02:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -l --list-name"
|
2018-12-18 03:02:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2018-12-18 03:02:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_arch() {
|
|
|
|
SPACK_COMPREPLY="-h --help --known-targets -p --platform -o --operating-system -t --target -f --frontend -b --backend"
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_blame() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -t --time -p --percent -g --git"
|
2018-03-25 21:03:29 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_build_env() {
|
2018-12-18 03:02:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --clean --dirty --dump --pickle"
|
2018-12-18 03:02:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2018-12-18 03:02:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache() {
|
2017-08-17 04:58:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-08-17 04:58:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="create install list keys preview check download get-buildcache-name save-yaml copy update-index"
|
2017-08-17 04:58:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_create() {
|
2017-08-17 04:58:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-06-27 06:05:56 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -r --rel -f --force -u --unsigned -a --allow-root -k --key -d --directory -m --mirror-name --mirror-url --rebuild-index -y --spec-yaml --only"
|
2017-08-17 04:58:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-08-17 04:58:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_install() {
|
2017-08-17 04:58:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-02-26 01:01:59 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -f --force -m --multiple -a --allow-root -u --unsigned -o --otherarch"
|
2020-01-07 13:18:14 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_list() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-06-27 06:05:56 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -l --long -L --very-long -v --variants -a --allarch"
|
2017-08-17 04:58:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-08-17 04:58:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_keys() {
|
|
|
|
SPACK_COMPREPLY="-h --help -i --install -t --trust -f --force"
|
2017-08-17 04:58:09 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_preview() {
|
2017-08-17 04:58:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-08-17 04:58:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-08-17 04:58:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_check() {
|
|
|
|
SPACK_COMPREPLY="-h --help -m --mirror-url -o --output-file --scope -s --spec -y --spec-yaml --rebuild-on-error"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_download() {
|
|
|
|
SPACK_COMPREPLY="-h --help -s --spec -y --spec-yaml -p --path -c --require-cdashid"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_get_buildcache_name() {
|
|
|
|
SPACK_COMPREPLY="-h --help -s --spec -y --spec-yaml"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_save_yaml() {
|
|
|
|
SPACK_COMPREPLY="-h --help --root-spec --root-spec-yaml -s --specs -y --yaml-dir"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_copy() {
|
|
|
|
SPACK_COMPREPLY="-h --help --base-dir --spec-yaml --destination-url"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_buildcache_update_index() {
|
2020-10-03 01:00:42 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -d --mirror-url -k --keys"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_cd() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -m --module-dir -r --spack-root -i --install-dir -p --package-dir -P --packages -s --stage-dir -S --stages -b --build-dir -e --env"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_checksum() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-05-08 07:34:36 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --keep-stage -b --batch"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_ci() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-05-13 06:17:50 +08:00
|
|
|
SPACK_COMPREPLY="generate rebuild"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_ci_generate() {
|
2020-06-17 12:01:35 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --output-file --copy-to --optimize --dependencies"
|
2020-01-06 15:35:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
_spack_ci_rebuild() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_clean() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-06-25 09:28:53 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -s --stage -d --downloads -f --failures -m --misc-cache -p --python-cache -a --all"
|
2020-01-06 15:35:23 +08:00
|
|
|
else
|
|
|
|
_all_packages
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_clone() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -r --remote"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_commands() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-24 06:48:06 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --update-completion -a --aliases --format --header --update"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY=""
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_compiler() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY="find add remove rm list info"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_compiler_find() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_compiler_add() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY=""
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_compiler_remove() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -a --all --scope"
|
|
|
|
else
|
|
|
|
_installed_compilers
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_compiler_rm() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -a --all --scope"
|
|
|
|
else
|
|
|
|
_installed_compilers
|
|
|
|
fi
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_compiler_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_compiler_info() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_compilers
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_compilers() {
|
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_concretize() {
|
|
|
|
SPACK_COMPREPLY="-h --help -f --force"
|
2018-12-18 03:02:09 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_config() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-07-31 18:58:48 +08:00
|
|
|
SPACK_COMPREPLY="get blame edit list add remove rm update revert"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_config_get() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_config_sections
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_config_blame() {
|
2018-12-18 03:02:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-12-18 03:02:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_config_sections
|
2018-12-18 03:02:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_config_edit() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --print-file"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_config_sections
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-25 09:28:20 +08:00
|
|
|
_spack_config_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
}
|
|
|
|
|
2020-06-25 15:38:01 +08:00
|
|
|
_spack_config_add() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -f --file"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_config_remove() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_config_rm() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-07-31 18:58:48 +08:00
|
|
|
_spack_config_update() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
|
|
|
else
|
|
|
|
_config_sections
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_config_revert() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
|
|
|
else
|
|
|
|
_config_sections
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-31 09:19:55 +08:00
|
|
|
_spack_containerize() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_create() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-07-08 15:38:42 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --keep-stage -n --name -t --template -r --repo -N --namespace -f --force --skip-editor -b --batch"
|
2020-01-06 15:35:23 +08:00
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_deactivate() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -f --force -v --view -a --all"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_debug() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-04-03 14:12:03 +08:00
|
|
|
SPACK_COMPREPLY="create-db-tarball report"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_debug_create_db_tarball() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-04-03 14:12:03 +08:00
|
|
|
_spack_debug_report() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_dependencies() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -i --installed -t --transitive --deptype -V --no-expand-virtuals"
|
2018-03-25 21:03:29 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_dependents() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -i --installed -t --transitive"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_deprecate() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all -d --dependencies -D --no-dependencies -i --install-deprecator -I --no-install-deprecator -l --link-type"
|
2020-01-07 13:18:14 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_dev_build() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-10-19 12:17:07 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -j --jobs -d --source-path -i --ignore-dependencies -n --no-checksum --keep-prefix --skip-patch -q --quiet --drop-in --test -b --before -u --until --clean --dirty"
|
2020-01-07 13:18:14 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-10-16 08:23:16 +08:00
|
|
|
_spack_develop() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -p --path --no-clone --clone -f --force"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_docs() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_edit() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -b --build-system -c --command -d --docs -t --test -m --module -r --repo -N --namespace"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-07-31 18:58:48 +08:00
|
|
|
SPACK_COMPREPLY="activate deactivate create remove rm list ls status st loads view update revert"
|
2018-12-18 03:02:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_activate() {
|
2018-12-18 03:02:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-07-01 03:26:27 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --sh --csh --fish -v --with-view -V --without-view -d --dir -p --prompt"
|
2018-12-18 03:02:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_environments
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_deactivate() {
|
2020-07-01 03:26:27 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --sh --csh --fish"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_create() {
|
2018-12-18 03:02:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -d --dir --without-view --with-view"
|
|
|
|
else
|
|
|
|
_environments
|
2018-12-18 03:02:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_remove() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
2020-01-07 13:18:14 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_environments
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_rm() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
|
|
|
else
|
|
|
|
_environments
|
|
|
|
fi
|
2018-12-18 03:02:09 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-12-18 03:02:09 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_ls() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-12-18 03:02:09 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_status() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_st() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_loads() {
|
2018-12-18 03:02:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -m --module-type --input-only -p --prefix -x --exclude -r --dependencies"
|
2018-12-18 03:02:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_environments
|
2018-12-18 03:02:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_env_view() {
|
2018-12-18 03:02:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-12-18 03:02:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY=""
|
2018-12-18 03:02:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-07-31 18:58:48 +08:00
|
|
|
_spack_env_update() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
|
|
|
else
|
|
|
|
_environments
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_env_revert() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
|
|
|
else
|
|
|
|
_environments
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_extensions() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -l --long -L --very-long -d --deps -p --paths -s --show -v --view"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_extensions
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-05-06 08:37:34 +08:00
|
|
|
_spack_external() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
2020-07-31 19:07:48 +08:00
|
|
|
SPACK_COMPREPLY="find list"
|
2020-05-06 08:37:34 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_external_find() {
|
|
|
|
if $list_options
|
|
|
|
then
|
2020-09-05 16:12:26 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --not-buildable --scope"
|
2020-05-06 08:37:34 +08:00
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-07-31 19:07:48 +08:00
|
|
|
_spack_external_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_fetch() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -n --no-checksum -m --missing -D --dependencies"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_find() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-23 14:36:02 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --format --json -d --deps -p --paths --groups --no-groups -l --long -L --very-long -t --tags -c --show-concretized -f --show-flags --show-full-compiler -x --explicit -X --implicit -u --unknown -m --missing -v --variants --loaded -M --only-missing --deprecated --only-deprecated -N --namespace --start-date --end-date"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_flake8() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
add mypy to style checks; rename `spack flake8` to `spack style` (#20384)
I lost my mind a bit after getting the completion stuff working and
decided to get Mypy working for spack as well. This adds a
`.mypy.ini` that checks all of the spack and llnl modules, though
not yet packages, and fixes all of the identified missing types and
type issues for the spack library.
In addition to these changes, this includes:
* rename `spack flake8` to `spack style`
Aliases flake8 to style, and just runs flake8 as before, but with
a warning. The style command runs both `flake8` and `mypy`,
in sequence. Added --no-<tool> options to turn off one or the
other, they are on by default. Fixed two issues caught by the tools.
* stub typing module for python2.x
We don't support typing in Spack for python 2.x. To allow 2.x to
support `import typing` and `from typing import ...` without a
try/except dance to support old versions, this adds a stub module
*just* for python 2.x. Doing it this way means we can only reliably
use all type hints in python3.7+, and mypi.ini has been updated to
reflect that.
* add non-default black check to spack style
This is a first step to requiring black. It doesn't enforce it by
default, but it will check it if requested. Currently enforcing the
line length of 79 since that's what flake8 requires, but it's a bit odd
for a black formatted project to be quite that narrow. All settings are
in the style command since spack has no pyproject.toml and I don't
want to add one until more discussion happens. Also re-format
`style.py` since it no longer passed the black style check
with the new length.
* use style check in github action
Update the style and docs action to use `spack style`, adding in mypy
and black to the action even if it isn't running black right now.
2020-12-23 13:39:10 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -b --base -a --all -o --output -r --root-relative -U --no-untracked --no-flake8 --no-mypy --black"
|
2020-01-06 15:35:23 +08:00
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_gc() {
|
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_gpg() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-03-25 21:03:29 +08:00
|
|
|
else
|
2020-09-26 00:54:24 +08:00
|
|
|
SPACK_COMPREPLY="verify trust untrust sign create list init export publish"
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_gpg_verify() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2020-01-07 13:18:14 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_gpg_trust() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_gpg_untrust() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --signing"
|
2020-01-07 13:18:14 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_keys
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
2018-03-25 21:03:29 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_gpg_sign() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --output --key --clearsign"
|
2018-03-25 21:03:29 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_gpg_create() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --comment --expires --export"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_gpg_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help --trusted --signing"
|
2018-03-25 21:03:29 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_gpg_init() {
|
|
|
|
SPACK_COMPREPLY="-h --help --from"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_gpg_export() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-03-25 21:03:29 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_keys
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-09-26 00:54:24 +08:00
|
|
|
_spack_gpg_publish() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -d --directory -m --mirror-name --mirror-url --rebuild-index"
|
|
|
|
else
|
|
|
|
_keys
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_graph() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -a --ascii -d --dot -s --static -i --installed --deptype"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_help() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -a --all --spec"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_subcommands
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_info() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_install() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-12-04 07:27:01 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --only -u --until -j --jobs --overwrite --fail-fast --keep-prefix --keep-stage --dont-restage --use-cache --no-cache --cache-only --include-build-deps --no-check-signature --require-full-hash-match --show-log-on-error --source -n --no-checksum -v --verbose --fake --only-concrete -f --file --clean --dirty --test --run-tests --log-format --log-file --help-cdash --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp -y --yes-to-all"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_license() {
|
2018-12-18 03:02:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2021-01-02 15:09:18 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --root"
|
2018-12-18 03:02:09 +08:00
|
|
|
else
|
2021-01-02 15:09:18 +08:00
|
|
|
SPACK_COMPREPLY="list-files verify update-copyright-year"
|
2018-12-18 03:02:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_license_list_files() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-12-18 03:02:09 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_license_verify() {
|
2021-01-02 15:09:18 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_license_update_copyright_year() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-12-18 03:02:09 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_list() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
spack test (#15702)
Users can add test() methods to their packages to run smoke tests on
installations with the new `spack test` command (the old `spack test` is
now `spack unit-test`). spack test is environment-aware, so you can
`spack install` an environment and then run `spack test run` to run smoke
tests on all of its packages. Historical test logs can be perused with
`spack test results`. Generic smoke tests for MPI implementations, C,
C++, and Fortran compilers as well as specific smoke tests for 18
packages.
Inside the test method, individual tests can be run separately (and
continue to run best-effort after a test failure) using the `run_test`
method. The `run_test` method encapsulates finding test executables,
running and checking return codes, checking output, and error handling.
This handles the following trickier aspects of testing with direct
support in Spack's package API:
- [x] Caching source or intermediate build files at build time for
use at test time.
- [x] Test dependencies,
- [x] packages that require a compiler for testing (such as library only
packages).
See the packaging guide for more details on using Spack testing support.
Included is support for package.py files for virtual packages. This does
not change the Spack interface, but is a major change in internals.
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: wspear <wjspear@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-11-18 18:39:02 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -d --search-description --format --update -v --virtuals -t --tags"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_load() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-07-01 03:26:27 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -r --dependencies --sh --csh --fish --first --only"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_location() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -m --module-dir -r --spack-root -i --install-dir -p --package-dir -P --packages -s --stage-dir -S --stages -b --build-dir -e --env"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_log_parse() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --show -c --context -p --profile -w --width -j --jobs"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_maintainers() {
|
2019-07-24 15:17:06 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --maintained --unmaintained -a --all --by-user"
|
2019-07-24 15:17:06 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2019-07-24 15:17:06 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-11-18 19:20:56 +08:00
|
|
|
_spack_mark() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -a --all -e --explicit -i --implicit"
|
|
|
|
else
|
|
|
|
_installed_packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_mirror() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -n --no-checksum"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="create add remove rm set-url list"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_mirror_create() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-06-04 08:43:51 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -d --directory -a --all -f --file --exclude-file --exclude-specs --skip-unstable-versions -D --dependencies -n --versions-per-spec"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_mirror_add() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
|
|
|
else
|
|
|
|
_mirrors
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_mirror_remove() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_mirrors
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_mirror_rm() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
|
|
|
else
|
|
|
|
_mirrors
|
|
|
|
fi
|
2018-03-25 21:03:29 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_mirror_set_url() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --push --scope"
|
2020-01-07 13:18:14 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_mirrors
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_mirror_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="lmod tcl"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_lmod() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-07-23 14:05:55 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="refresh find rm loads setdefault"
|
2018-07-23 14:05:55 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_lmod_refresh() {
|
2018-07-23 14:05:55 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --delete-tree --upstream-modules -y --yes-to-all"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_lmod_find() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --full-path -r --dependencies"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_lmod_rm() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
2018-07-23 14:05:55 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2018-07-23 14:05:55 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_lmod_loads() {
|
2018-07-23 14:05:55 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --input-only -p --prefix -x --exclude -r --dependencies"
|
2018-07-23 14:05:55 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2018-07-23 14:05:55 +08:00
|
|
|
fi
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
2018-07-23 14:05:55 +08:00
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_lmod_setdefault() {
|
2018-07-23 14:05:55 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-07-23 14:05:55 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2018-07-23 14:05:55 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_tcl() {
|
2018-07-23 14:05:55 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-07-23 14:05:55 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="refresh find rm loads"
|
2018-07-23 14:05:55 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_tcl_refresh() {
|
2018-07-23 14:05:55 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --delete-tree --upstream-modules -y --yes-to-all"
|
2018-07-23 14:05:55 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2018-07-23 14:05:55 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_tcl_find() {
|
2018-07-23 14:05:55 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --full-path -r --dependencies"
|
2018-07-23 14:05:55 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2018-07-23 14:05:55 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_tcl_rm() {
|
2018-07-23 14:05:55 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
2018-07-23 14:05:55 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2018-07-23 14:05:55 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_module_tcl_loads() {
|
2018-07-23 14:05:55 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --input-only -p --prefix -x --exclude -r --dependencies"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_patch() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -n --no-checksum"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_pkg() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="add list diff added changed removed"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_pkg_add() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_pkg_list() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_pkg_diff() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_pkg_added() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_pkg_changed() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -t --type"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_pkg_removed() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_providers() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_providers
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_pydoc() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_python() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-04-03 14:12:03 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -V --version -c -m"
|
2020-01-06 15:35:23 +08:00
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_reindex() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_remove() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -a --all -l --list-name -f --force"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_rm() {
|
2018-12-18 03:02:09 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -a --all -l --list-name -f --force"
|
2018-12-18 03:02:09 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2018-12-18 03:02:09 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_repo() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="create list add remove rm"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_repo_create() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
_repos
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_repo_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_repo_add() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_repo_remove() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_repos
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_repo_rm() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --scope"
|
|
|
|
else
|
|
|
|
_repos
|
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_resource() {
|
2018-12-25 05:42:15 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-12-25 05:42:15 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="list show"
|
2018-12-25 05:42:15 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_resource_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help --only-hashes"
|
2018-12-25 05:42:15 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_resource_show() {
|
2018-12-25 05:42:15 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2018-12-25 05:42:15 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_resource_hashes
|
2018-12-25 05:42:15 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_restage() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_setup() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -i --ignore-dependencies -n --no-checksum -v --verbose --clean --dirty"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-06-08 02:48:22 +08:00
|
|
|
_spack_solve() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --show --models -l --long -L --very-long -I --install-status -y --yaml -j --json -c --cover -N --namespaces -t --types --timers --stats"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_spec() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -l --long -L --very-long -I --install-status -y --yaml -j --json -c --cover -N --namespaces -t --types"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_stage() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -n --no-checksum -p --path"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
add mypy to style checks; rename `spack flake8` to `spack style` (#20384)
I lost my mind a bit after getting the completion stuff working and
decided to get Mypy working for spack as well. This adds a
`.mypy.ini` that checks all of the spack and llnl modules, though
not yet packages, and fixes all of the identified missing types and
type issues for the spack library.
In addition to these changes, this includes:
* rename `spack flake8` to `spack style`
Aliases flake8 to style, and just runs flake8 as before, but with
a warning. The style command runs both `flake8` and `mypy`,
in sequence. Added --no-<tool> options to turn off one or the
other, they are on by default. Fixed two issues caught by the tools.
* stub typing module for python2.x
We don't support typing in Spack for python 2.x. To allow 2.x to
support `import typing` and `from typing import ...` without a
try/except dance to support old versions, this adds a stub module
*just* for python 2.x. Doing it this way means we can only reliably
use all type hints in python3.7+, and mypi.ini has been updated to
reflect that.
* add non-default black check to spack style
This is a first step to requiring black. It doesn't enforce it by
default, but it will check it if requested. Currently enforcing the
line length of 79 since that's what flake8 requires, but it's a bit odd
for a black formatted project to be quite that narrow. All settings are
in the style command since spack has no pyproject.toml and I don't
want to add one until more discussion happens. Also re-format
`style.py` since it no longer passed the black style check
with the new length.
* use style check in github action
Update the style and docs action to use `spack style`, adding in mypy
and black to the action even if it isn't running black right now.
2020-12-23 13:39:10 +08:00
|
|
|
_spack_style() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -b --base -a --all -o --output -r --root-relative -U --no-untracked --no-flake8 --no-mypy --black"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_test() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
spack test (#15702)
Users can add test() methods to their packages to run smoke tests on
installations with the new `spack test` command (the old `spack test` is
now `spack unit-test`). spack test is environment-aware, so you can
`spack install` an environment and then run `spack test run` to run smoke
tests on all of its packages. Historical test logs can be perused with
`spack test results`. Generic smoke tests for MPI implementations, C,
C++, and Fortran compilers as well as specific smoke tests for 18
packages.
Inside the test method, individual tests can be run separately (and
continue to run best-effort after a test failure) using the `run_test`
method. The `run_test` method encapsulates finding test executables,
running and checking return codes, checking output, and error handling.
This handles the following trickier aspects of testing with direct
support in Spack's package API:
- [x] Caching source or intermediate build files at build time for
use at test time.
- [x] Test dependencies,
- [x] packages that require a compiler for testing (such as library only
packages).
See the packaging guide for more details on using Spack testing support.
Included is support for package.py files for virtual packages. This does
not change the Spack interface, but is a major change in internals.
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: wspear <wjspear@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-11-18 18:39:02 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
spack test (#15702)
Users can add test() methods to their packages to run smoke tests on
installations with the new `spack test` command (the old `spack test` is
now `spack unit-test`). spack test is environment-aware, so you can
`spack install` an environment and then run `spack test run` to run smoke
tests on all of its packages. Historical test logs can be perused with
`spack test results`. Generic smoke tests for MPI implementations, C,
C++, and Fortran compilers as well as specific smoke tests for 18
packages.
Inside the test method, individual tests can be run separately (and
continue to run best-effort after a test failure) using the `run_test`
method. The `run_test` method encapsulates finding test executables,
running and checking return codes, checking output, and error handling.
This handles the following trickier aspects of testing with direct
support in Spack's package API:
- [x] Caching source or intermediate build files at build time for
use at test time.
- [x] Test dependencies,
- [x] packages that require a compiler for testing (such as library only
packages).
See the packaging guide for more details on using Spack testing support.
Included is support for package.py files for virtual packages. This does
not change the Spack interface, but is a major change in internals.
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: wspear <wjspear@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-11-18 18:39:02 +08:00
|
|
|
SPACK_COMPREPLY="run list find status results remove"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_test_run() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --alias --fail-fast --fail-first --keep-stage --log-format --log-file --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp --help-cdash --clean --dirty"
|
|
|
|
else
|
|
|
|
_installed_packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_test_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_test_find() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_test_status() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_test_results() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -l --logs -f --failed"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_test_remove() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_test_env() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --clean --dirty --dump --pickle"
|
|
|
|
else
|
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-11-09 19:47:08 +08:00
|
|
|
_spack_tutorial() {
|
|
|
|
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
|
|
|
}
|
|
|
|
|
2020-10-16 08:23:16 +08:00
|
|
|
_spack_undevelop() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -a --all"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_uninstall() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -f --force -R --dependents -y --yes-to-all -a --all"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
spack test (#15702)
Users can add test() methods to their packages to run smoke tests on
installations with the new `spack test` command (the old `spack test` is
now `spack unit-test`). spack test is environment-aware, so you can
`spack install` an environment and then run `spack test run` to run smoke
tests on all of its packages. Historical test logs can be perused with
`spack test results`. Generic smoke tests for MPI implementations, C,
C++, and Fortran compilers as well as specific smoke tests for 18
packages.
Inside the test method, individual tests can be run separately (and
continue to run best-effort after a test failure) using the `run_test`
method. The `run_test` method encapsulates finding test executables,
running and checking return codes, checking output, and error handling.
This handles the following trickier aspects of testing with direct
support in Spack's package API:
- [x] Caching source or intermediate build files at build time for
use at test time.
- [x] Test dependencies,
- [x] packages that require a compiler for testing (such as library only
packages).
See the packaging guide for more details on using Spack testing support.
Included is support for package.py files for virtual packages. This does
not change the Spack interface, but is a major change in internals.
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: wspear <wjspear@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-11-18 18:39:02 +08:00
|
|
|
_spack_unit_test() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help -H --pytest-help -l --list -L --list-long -N --list-names --extension -s -k --showlocals"
|
|
|
|
else
|
|
|
|
_tests
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_unload() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-07-01 03:26:27 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --sh --csh --fish -a --all"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_installed_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_url() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="parse list summary stats"
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_url_parse() {
|
2018-03-25 21:03:29 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -s --spider"
|
|
|
|
else
|
|
|
|
SPACK_COMPREPLY=""
|
2018-03-25 21:03:29 +08:00
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_url_list() {
|
|
|
|
SPACK_COMPREPLY="-h --help -c --color -e --extrapolation -n --incorrect-name -N --correct-name -v --incorrect-version -V --correct-version"
|
2018-12-18 03:02:09 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_url_summary() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_url_stats() {
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_verify() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -l --local -j --json -a --all -s --specs -f --files"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_versions() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-12-07 23:29:10 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -s --safe --safe-only -r --remote -n --new -c --concurrency"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help -v --verbose -e --exclude -d --dependencies"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-06-04 00:45:13 +08:00
|
|
|
SPACK_COMPREPLY="symlink add soft hardlink hard copy relocate remove rm statlink status check"
|
2020-01-07 13:18:14 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_symlink() {
|
2020-01-07 13:18:14 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --projection-file -i --ignore-conflicts"
|
|
|
|
else
|
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_add() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --projection-file -i --ignore-conflicts"
|
|
|
|
else
|
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_soft() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --projection-file -i --ignore-conflicts"
|
|
|
|
else
|
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_hardlink() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help --projection-file -i --ignore-conflicts"
|
|
|
|
else
|
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_hard() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --projection-file -i --ignore-conflicts"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-06-04 00:45:13 +08:00
|
|
|
_spack_view_copy() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --projection-file -i --ignore-conflicts"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_spack_view_relocate() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --projection-file -i --ignore-conflicts"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_remove() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --no-remove-dependents -a --all"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_rm() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help --no-remove-dependents -a --all"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
2018-12-18 03:02:09 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_statlink() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
2020-01-07 13:18:14 +08:00
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_status() {
|
2017-02-07 04:34:35 +08:00
|
|
|
if $list_options
|
|
|
|
then
|
2020-01-06 15:35:23 +08:00
|
|
|
SPACK_COMPREPLY="-h --help"
|
2017-02-07 04:34:35 +08:00
|
|
|
else
|
2020-01-06 15:35:23 +08:00
|
|
|
_all_packages
|
2017-02-07 04:34:35 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-01-06 15:35:23 +08:00
|
|
|
_spack_view_check() {
|
|
|
|
if $list_options
|
|
|
|
then
|
|
|
|
SPACK_COMPREPLY="-h --help"
|
|
|
|
else
|
|
|
|
_all_packages
|
|
|
|
fi
|
2017-02-07 04:34:35 +08:00
|
|
|
}
|