-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·48 lines (37 loc) · 1.14 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/python3
# -*- coding: utf-8 -*-
import argparse
import sys
import argcomplete
import nutcli.commands
import nutcli.runner
import commands.projects
import commands.sssd
import commands.ci
class Program:
def setup_parser(self):
parser = argparse.ArgumentParser(
formatter_class=argparse.RawTextHelpFormatter
)
nutcli.commands.CommandParser()([
nutcli.commands.CommandGroup('Project Managers')([
commands.projects.Commands,
]),
nutcli.commands.CommandGroup('Containers')([
commands.ci.Commands,
]),
nutcli.commands.CommandGroup('Old')([
commands.sssd.Commands,
]),
]).setup_parser(parser)
argcomplete.autocomplete(parser)
return parser
def main(self, argv):
parser = self.setup_parser()
runner = nutcli.runner.Runner('my', parser).setup_parser()
args = runner.parse_args(argv)
runner.default_logger()
return runner.execute(args)
if __name__ == "__main__":
program = Program()
sys.exit(program.main(sys.argv[1:]))