#!/usr/bin/env python3 # This file is part of kytos-utils. # # Copyright (c) 2016-2019 by Kytos Team. # # Authors: # Beraldo Leal """kytos - The kytos command line. Usage: kytos [-c |--config ] [...] kytos [-v|--version] kytos [-h|--help] Options: -c , --config Load config file [default: ~/.kytosrc] -h, --help Show this screen. -v, --version Show version. The most commonly used kytos commands are: napps Create, list, enable, install (and other actions) NApps. server Start, Stop your Kytos Controller (Kytos) web Manage the Web User Interface users Commands to handle users from NApps server. See 'kytos -h|--help' for more information on a specific command. """ import logging import os from docopt import docopt from kytos.utils.config import KytosConfig logging.basicConfig(format='%(levelname)-5s %(message)s', level=logging.INFO) if __name__ == '__main__': metadata = KytosConfig().get_metadata() version = metadata.get('__version__') args = docopt(__doc__, version='kytos command line, version %s' % version, options_first=True) command = args[''] command_args = args[''] argv = [command] + command_args if command == 'napps': from kytos.cli.commands.napps.parser import parse parse(argv) elif command == 'users': from kytos.cli.commands.users.parser import parse parse(argv) elif command == 'web': from kytos.cli.commands.web.parser import parse parse(argv) else: print("Error: Invalid syntax") exit(__doc__)