Beispiel #1
0
    def __init__(self, name: str) -> None:

        parser = ArgumentParser(prog=name)

        parser.add_argument('config', nargs='?')

        Command.__init__(self, name, parser)
Beispiel #2
0
    def __init__(self, name: str) -> None:

        parser = ArgumentParser(prog=name)

        parser.add_argument('pid', type=int, nargs=argparse.REMAINDER)

        Command.__init__(self, name, parser)
Beispiel #3
0
    def __init__(self, name: str) -> None:

        parser = ArgumentParser(prog=name)

        parser.add_argument('path', nargs='?')

        super().__init__(name, parser)
Beispiel #4
0
    def __init__(self, name: str) -> None:
        parser = ArgumentParser(prog=name)

        subparsers = parser.add_subparsers()
        ls_parser = subparsers.add_parser('ls')
        ls_parser.set_defaults(subcommand=self.command_ls)
        ls_parser.add_argument('kn', type=ArgumentParser.address)
        ls_parser.add_argument('-R', type=int, default=0)
        ls_parser.add_argument('-f', action='store_false', default=True)

        super().__init__(name, parser)
Beispiel #5
0
    def __init__(self, name: str) -> None:
        parser = ArgumentParser(prog=name)

        group = parser.add_mutually_exclusive_group()
        group.add_argument('-s', action='store_true', default=False,
                           dest='slabcheck')
        group.add_argument('-S', action="count", dest='slablist')
        group.add_argument('-z', action='store_true', default=False)
        group.add_argument('-V', action='store_true', default=False)
        parser.add_argument('address', nargs='?')

        super().__init__(name, parser)
Beispiel #6
0
    def __init__(self, name: str) -> None:
        parser = ArgumentParser(prog=name)
        group = parser.add_mutually_exclusive_group()

        group.add_argument('-t', type=int, default=False,
                           help='Show task cgroup membership')
        group.add_argument('-g', type=ArgumentParser.address, default=False,
                           help='List all tasks in cgroup')
        group.add_argument('-s', type=int, default=False, # TODO cgroup arg type
                           help='Show cgroup attributes')
        group.add_argument('-c', type=str, nargs=2, default=False, # TODO cgroup arg type
                           help='Show controller attributes of cgroup')

        super().__init__(name, parser)
Beispiel #7
0
    def __init__(self, name: str) -> None:
        parser = ArgumentParser(prog=name)
        subparsers = parser.add_subparsers(help="sub-command help")
        show_parser = subparsers.add_parser('show', help='show help')
        show_parser.set_defaults(subcommand=self.show_xfs)
        show_parser.add_argument('addr')
        list_parser = subparsers.add_parser('list', help='list help')
        list_parser.set_defaults(subcommand=self.list_xfs)
        ail_parser = subparsers.add_parser('dump-ail', help='ail help')
        ail_parser.set_defaults(subcommand=self.dump_ail)
        ail_parser.add_argument('addr')
        buft_parser = subparsers.add_parser('dump-buft', help='buft help')
        buft_parser.set_defaults(subcommand=self.dump_buftargs)
        buft_parser.add_argument('addr')

        Command.__init__(self, name, parser)
Beispiel #8
0
    def __init__(self) -> None:
        parser = ArgumentParser(prog="lsmod")

        parser.add_argument('-p', nargs='?', const=-1, default=None, type=int)
        parser.add_argument('args', nargs=argparse.REMAINDER)

        Command.__init__(self, "lsmod", parser)
Beispiel #9
0
    def __init__(self, name: str) -> None:
        parser = ArgumentParser(prog=name)

        parser.add_argument('-v', action='store_true', default=False)
        parser.add_argument('-f', action='store_true', default=False)
        parser.add_argument('-d', action='store_true', default=False)

        super().__init__(name, parser)
Beispiel #10
0
    def __init__(self, name: str) -> None:
        parser = ArgumentParser(prog=name)

        parser.add_argument('-t', action='store_true', default=False)
        parser.add_argument('-d', action='store_true', default=False)
        parser.add_argument('-m', action='store_true', default=False)

        Command.__init__(self, name, parser)
Beispiel #11
0
 def __init__(self) -> None:
     parser = ArgumentParser(prog="help")
     parser.add_argument('args', nargs=argparse.REMAINDER)
     super().__init__('help', parser)