def parse_command_line(arguments): """Parse the LS-GROUPS command command-line arguments Returns the account id that is provided on the command line. If no account is provided, returns None. :param arguments: a list of command-line arguments to parse :type arguments: list[str] :rtype: str """ parser = argparse.ArgumentParser(description='List account groups') expect_account_as_positional(parser) cmdline = parser.parse_args(arguments) # fetch changes details return cmdline.account
def parse_command_line(arguments): """Parse the SSH-KEY command command-line arguments :param arguments: a list of command-line arguments to parse :type arguments: list[str] :rtype: Namespace """ parser = argparse.ArgumentParser(description='Manage ssh key(s)') expect_account_as_positional(parser) actions = parser.add_subparsers(dest='cmd', help='available commands') get_cmd = actions.add_parser('get', help='Display SSH key details') get_cmd.add_argument('uuid', type=int, help='SSH key ID') cmdline = parser.parse_args(arguments) # fetch changes details return cmdline