57ae0530c0819dcdfe16ea53ee8de240b3c343ce
[osm/vim-emu.git] / emuvim / cli / son-emu-cli
1 #!/usr/bin/python
2 """
3  Simple CLI client to interact with a running emulator.
4
5  The CLI offers different tools, e.g., compute, network, ...
6  Each of these tools is implemented as an independent Python
7  module.
8
9  cli compute start dc1 my_name flavor_a
10  cli network create dc1 11.0.0.0/24
11 """
12
13 import sys
14 import compute
15 import network
16
17
18 def main():
19     if len(sys.argv) < 2:
20         print "Usage: son-emu-cli <toolname> <arguments>"
21         exit(0)
22     if sys.argv[1] == "compute":
23         compute.main(sys.argv[2:])
24     elif sys.argv[1] == "network":
25         network.main(sys.argv[2:])
26
27 if __name__ == '__main__':
28     main()