-
Notifications
You must be signed in to change notification settings - Fork 3
/
gzdev.py
executable file
·38 lines (30 loc) · 1.05 KB
/
gzdev.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
38
#!/usr/bin/env python3
# Copyright 2018 David Rosa
# Licensed under the Apache License, Version 2.0
"""
Streamline many of the usual tasks that Gazebo developers face on a daily basis.
Usage:
gzdev [--version] [--help]
<command> [<args>...]
gzdev -h | --help
gzdev --version
Options:
-h --help Show this screen.
--version Show gzdev's version.
Commands/Plugins:
ign-docker-env Launch a docker container with default Ignition project configuration
repository Enable/Disable gazebo repositories.
"""
from importlib import import_module
from sys import stderr
from docopt import docopt
if __name__ == '__main__':
args = docopt(str(__doc__), version='gzdev-core 0.1.0', options_first=True)
cmd = args['<command>']
is_valid = {'ign-docker-env': True,
'repository': True}
if is_valid.get(cmd):
plugin = import_module('plugins.' + cmd)
plugin.main()
else:
print('\nERROR: `%s` is not a valid gzdev plugin.\n' % cmd, file=stderr)