Remove deprecated --safe-only
in spack version cmd (#45765)
This commit is contained in:
parent
20bf239a6a
commit
428b4e340a
@ -23,11 +23,6 @@ def setup_parser(subparser):
|
||||
output.add_argument(
|
||||
"-s", "--safe", action="store_true", help="only list safe versions of the package"
|
||||
)
|
||||
output.add_argument(
|
||||
"--safe-only",
|
||||
action="store_true",
|
||||
help="[deprecated] only list safe versions of the package",
|
||||
)
|
||||
output.add_argument(
|
||||
"-r", "--remote", action="store_true", help="only list remote versions of the package"
|
||||
)
|
||||
@ -47,17 +42,13 @@ def versions(parser, args):
|
||||
|
||||
safe_versions = pkg.versions
|
||||
|
||||
if args.safe_only:
|
||||
tty.warn('"--safe-only" is deprecated. Use "--safe" instead.')
|
||||
args.safe = args.safe_only
|
||||
|
||||
if not (args.remote or args.new):
|
||||
if sys.stdout.isatty():
|
||||
tty.msg("Safe versions (already checksummed):")
|
||||
|
||||
if not safe_versions:
|
||||
if sys.stdout.isatty():
|
||||
tty.warn("Found no versions for {0}".format(pkg.name))
|
||||
tty.warn(f"Found no versions for {pkg.name}")
|
||||
tty.debug("Manually add versions to the package.")
|
||||
else:
|
||||
colify(sorted(safe_versions, reverse=True), indent=2)
|
||||
@ -83,12 +74,12 @@ def versions(parser, args):
|
||||
if not remote_versions:
|
||||
if sys.stdout.isatty():
|
||||
if not fetched_versions:
|
||||
tty.warn("Found no versions for {0}".format(pkg.name))
|
||||
tty.warn(f"Found no versions for {pkg.name}")
|
||||
tty.debug(
|
||||
"Check the list_url and list_depth attributes of "
|
||||
"the package to help Spack find versions."
|
||||
)
|
||||
else:
|
||||
tty.warn("Found no unchecksummed versions for {0}".format(pkg.name))
|
||||
tty.warn(f"Found no unchecksummed versions for {pkg.name}")
|
||||
else:
|
||||
colify(sorted(remote_versions, reverse=True), indent=2)
|
||||
|
@ -11,13 +11,6 @@
|
||||
versions = SpackCommand("versions")
|
||||
|
||||
|
||||
def test_safe_only_versions():
|
||||
"""Only test the safe versions of a package.
|
||||
(Using the deprecated command line argument)
|
||||
"""
|
||||
versions("--safe-only", "zlib")
|
||||
|
||||
|
||||
def test_safe_versions():
|
||||
"""Only test the safe versions of a package."""
|
||||
|
||||
|
@ -2022,7 +2022,7 @@ _spack_verify() {
|
||||
_spack_versions() {
|
||||
if $list_options
|
||||
then
|
||||
SPACK_COMPREPLY="-h --help -s --safe --safe-only -r --remote -n --new -j --jobs"
|
||||
SPACK_COMPREPLY="-h --help -s --safe -r --remote -n --new -j --jobs"
|
||||
else
|
||||
_all_packages
|
||||
fi
|
||||
|
@ -3103,14 +3103,12 @@ complete -c spack -n '__fish_spack_using_command verify' -s f -l files -f -a typ
|
||||
complete -c spack -n '__fish_spack_using_command verify' -s f -l files -d 'treat entries as absolute filenames'
|
||||
|
||||
# spack versions
|
||||
set -g __fish_spack_optspecs_spack_versions h/help s/safe safe-only r/remote n/new j/jobs=
|
||||
set -g __fish_spack_optspecs_spack_versions h/help s/safe r/remote n/new j/jobs=
|
||||
complete -c spack -n '__fish_spack_using_command_pos 0 versions' -f -a '(__fish_spack_packages)'
|
||||
complete -c spack -n '__fish_spack_using_command versions' -s h -l help -f -a help
|
||||
complete -c spack -n '__fish_spack_using_command versions' -s h -l help -d 'show this help message and exit'
|
||||
complete -c spack -n '__fish_spack_using_command versions' -s s -l safe -f -a safe
|
||||
complete -c spack -n '__fish_spack_using_command versions' -s s -l safe -d 'only list safe versions of the package'
|
||||
complete -c spack -n '__fish_spack_using_command versions' -l safe-only -f -a safe_only
|
||||
complete -c spack -n '__fish_spack_using_command versions' -l safe-only -d '[deprecated] only list safe versions of the package'
|
||||
complete -c spack -n '__fish_spack_using_command versions' -s r -l remote -f -a remote
|
||||
complete -c spack -n '__fish_spack_using_command versions' -s r -l remote -d 'only list remote versions of the package'
|
||||
complete -c spack -n '__fish_spack_using_command versions' -s n -l new -f -a new
|
||||
|
Loading…
Reference in New Issue
Block a user