-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
37 lines (24 loc) · 906 Bytes
/
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
from linux_profile.main import BuildCommand
from linux_profile.base.command import BaseCommand
from linux_dev.commands import HelloWorld
class ArgsCommand(BaseCommand):
def __init__(self, parser):
super().__init__(parser)
# "hello" command launcher.
self.setup_hello()
def setup_hello(self):
"""Argument loading method for the new command.
"""
self.cmd_hello = self.subparsers.add_parser('hello', help="My custom command")
self.cmd_hello = self.cmd_hello.add_argument_group('Usage: linuxp hello [OPTIONS]')
self.cmd_hello.add_argument('--message')
class Build(BuildCommand):
base_command = ArgsCommand
def setup(self) -> str:
"""Method for initializing custom commands.
"""
self.command.cmd_hello.set_defaults(exec=HelloWorld)
def main():
Build()
if __name__ == '__main__':
main()