traefik-helper-kubernetes/app.py
2024-09-21 05:46:47 +01:00

29 lines
722 B
Python

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