예제 #1
0
파일: ls-groups.py 프로젝트: 0xcharly/pycr
    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
예제 #2
0
파일: ls-groups.py 프로젝트: sjl421/pycr
    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
예제 #3
0
    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