uninstall : renamed --recursive to --dependents

This commit is contained in:
alalazo 2016-04-04 10:28:47 +02:00
parent 4f6320a7eb
commit 401dcb3635
2 changed files with 6 additions and 6 deletions

View file

@ -62,7 +62,7 @@ def setup_parser(subparser):
"supplied spec. i.e., if you say uninstall libelf, ALL versions of " +
"libelf are uninstalled. This is both useful and dangerous, like rm -r.")
subparser.add_argument(
'-r', '--recursive', action='store_true', dest='recursive',
'-d', '--dependents', action='store_true', dest='dependents',
help='Also uninstall any packages that depend on the ones given via command line.'
)
subparser.add_argument(
@ -168,7 +168,7 @@ def uninstall(parser, args):
# Process dependent_list and update uninstall_list
has_error = False
if dependent_list and not args.recursive and not args.force:
if dependent_list and not args.dependents and not args.force:
for spec, lst in dependent_list.items():
tty.error("Will not uninstall %s" % spec.format("$_$@$%@$#", color=True))
print('')
@ -176,7 +176,7 @@ def uninstall(parser, args):
display_specs(lst, long=True)
print('')
has_error = True
elif args.recursive:
elif args.dependents:
for key, lst in dependent_list.items():
uninstall_list.extend(lst)
uninstall_list = list(set(uninstall_list))

View file

@ -4,11 +4,11 @@
class MockArgs(object):
def __init__(self, packages, all=False, force=False, recursive=False):
def __init__(self, packages, all=False, force=False, dependents=False):
self.packages = packages
self.all = all
self.force = force
self.recursive = recursive
self.dependents = dependents
self.yes_to_all = True
@ -22,7 +22,7 @@ def test_uninstall(self):
args = MockArgs(['libelf'])
self.assertRaises(SystemExit, uninstall, parser, args)
# Recursive uninstall
args = MockArgs(['callpath'], all=True, recursive=True)
args = MockArgs(['callpath'], all=True, dependents=True)
uninstall(parser, args)
all_specs = spack.install_layout.all_specs()