| Total Complexity | 3 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | """kytos - The kytos command line. |
||
| 2 | |||
| 3 | You are at the "web" command. |
||
| 4 | |||
| 5 | Usage: |
||
| 6 | kytos web update |
||
| 7 | kytos web update <version> |
||
| 8 | |||
| 9 | Options: |
||
| 10 | |||
| 11 | -h, --help Show this screen. |
||
| 12 | |||
| 13 | Common web subcommands: |
||
| 14 | |||
| 15 | update Update the web-ui with the latest version |
||
| 16 | |||
| 17 | """ |
||
| 18 | import sys |
||
| 19 | |||
| 20 | from docopt import docopt |
||
| 21 | |||
| 22 | from kytos.cli.commands.web.api import WebAPI |
||
| 23 | from kytos.utils.exceptions import KytosException |
||
| 24 | |||
| 25 | |||
| 26 | def parse(argv): |
||
| 27 | """Parse cli args.""" |
||
| 28 | args = docopt(__doc__, argv=argv) |
||
| 29 | try: |
||
| 30 | call(sys.argv[2], args) |
||
| 31 | except KytosException as exception: |
||
| 32 | print("Error parsing args: {}".format(exception)) |
||
| 33 | exit() |
||
| 34 | |||
| 35 | |||
| 36 | def call(subcommand, args): # pylint: disable=unused-argument |
||
| 37 | """Call a subcommand passing the args.""" |
||
| 38 | func = getattr(WebAPI, subcommand) |
||
| 39 | func(args) |
||
| 40 |