diff --git a/qvm-tools/qvm-shutdown b/qvm-tools/qvm-shutdown index 98f19d23..81b1fab4 100755 --- a/qvm-tools/qvm-shutdown +++ b/qvm-tools/qvm-shutdown @@ -47,7 +47,7 @@ def main(): "repeated)") (options, args) = parser.parse_args () - if not options.shutdown_all and (len (args) != 1): + if not options.shutdown_all and not args: parser.error ("You must specify VM name!") qvm_collection = QubesVmCollection() @@ -66,12 +66,12 @@ def main(): if vm.is_running(): vms_list.append (vm) else: - vmname = args[0] - vm = qvm_collection.get_vm_by_name(vmname) - if vm is None: - print >> sys.stderr, "A VM with the name '{0}' does not exist in the system!".format(vmname) - exit(1) - vms_list.append(vm) + for vmname in args: + vm = qvm_collection.get_vm_by_name(vmname) + if vm is None: + print >> sys.stderr, "A VM with the name '{0}' does not exist in the system!".format(vmname) + exit(1) + vms_list.append(vm) # Check VMs network dependencies if not options.force: