2024-09-21 04:38:15 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
from cliff.app import App
|
|
|
|
from cliff.commandmanager import CommandManager
|
|
|
|
|
|
|
|
from commands import addService
|
|
|
|
from commands import deleteService
|
|
|
|
|
|
|
|
class TraefikHelper(App):
|
2024-09-21 04:42:26 +00:00
|
|
|
def __init__(self):
|
|
|
|
super().__init__(
|
|
|
|
description='Traefik Helper',
|
|
|
|
version='0.1',
|
|
|
|
command_manager=CommandManager('commands'),
|
|
|
|
deferred_help=False,
|
|
|
|
)
|
2024-09-21 04:38:15 +00:00
|
|
|
|
|
|
|
def main(argv=sys.argv[1:]):
|
2024-09-21 04:42:26 +00:00
|
|
|
app = TraefikHelper()
|
|
|
|
app.command_manager.add_command('add', addService.AddService)
|
|
|
|
app.command_manager.add_command('delete', deleteService.DeleteService)
|
2024-09-21 04:46:47 +00:00
|
|
|
|
|
|
|
if len(argv) == 0: # Disable the stupid interactive help
|
|
|
|
app.run(['--help'])
|
|
|
|
|
2024-09-21 04:42:26 +00:00
|
|
|
return app.run(argv)
|
2024-09-21 04:38:15 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2024-09-21 04:42:26 +00:00
|
|
|
sys.exit(main(sys.argv[1:]))
|