From 68aaedbd06766e156b5ffd2b351de0fc818ee6ad Mon Sep 17 00:00:00 2001 From: peusterm Date: Thu, 15 Jun 2017 14:27:46 +0200 Subject: [PATCH] Better help for son-emu-cli --- src/emuvim/cli/son_emu_cli.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/emuvim/cli/son_emu_cli.py b/src/emuvim/cli/son_emu_cli.py index c45a5f1..0223818 100755 --- a/src/emuvim/cli/son_emu_cli.py +++ b/src/emuvim/cli/son_emu_cli.py @@ -43,11 +43,19 @@ from emuvim.cli.rest import datacenter as restdc from emuvim.cli.rest import monitor as restmon from emuvim.cli.rest import network as restnetw +def help(): + print("Missing arguments.\n") + print("Usage: son-emu-cli compute|datacenter|network|monitor \n") + print("Get more help:") + print("\tson-emu-cli compute --help") + print("\tson-emu-cli datacenter --help") + print("\tson-emu-cli network --help") + print("\tson-emu-cli monitor --help") + exit(0) def main(): if len(sys.argv) < 2: - print("Usage: son-emu-cli compute|datacenter|network|monitor ") - exit(0) + help() elif sys.argv[1] == "monitor": restmon.main(sys.argv[2:]) elif sys.argv[1] == "network": @@ -56,6 +64,8 @@ def main(): restcom.main(sys.argv[2:]) elif sys.argv[1] == "datacenter": restdc.main(sys.argv[2:]) + else: + help() if __name__ == '__main__': -- 2.25.1