Fix VmNameGroup formatting

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-05-22 19:18:57 +02:00
parent 2f0df26606
commit c4a506206c
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -489,17 +489,20 @@ class VmNameGroup(argparse._MutuallyExclusiveGroup):
:py:class:``argparse.ArgumentParser```. :py:class:``argparse.ArgumentParser```.
''' '''
def __init__(self, container, required, vm_action=VmNameAction): def __init__(self, container, required, vm_action=VmNameAction, help=None):
# pylint: disable=redefined-builtin
super(VmNameGroup, self).__init__(container, required=required) super(VmNameGroup, self).__init__(container, required=required)
self.add_argument('--all', action='store_true', if not help:
dest='all_domains', help = 'perform the action on all qubes'
help='perform the action on all qubes') self.add_argument('--all', action='store_true', dest='all_domains',
help=help)
container.add_argument('--exclude', action='append', default=[], container.add_argument('--exclude', action='append', default=[],
help='exclude the qube from --all') help='exclude the qube from --all')
self.add_argument('VMNAME', action=vm_action, nargs='*',
default=[]) # the default parameter is important! see # ⚠ the default parameter below is important! ⚠
# https://stackoverflow.com/questions/35044288 # See https://stackoverflow.com/questions/35044288 and
# and `argparse.ArgumentParser.parse_args()` # `argparse.ArgumentParser.parse_args()` implementation
self.add_argument('VMNAME', action=vm_action, nargs='*', default=[])
def print_table(table): def print_table(table):