diff --git a/bluepymm/main.py b/bluepymm/main.py
index f77c959cc7d609c6b22ede9e21a269001676ab4e..608936f97c83a6b84f9409c8e7d8a97fb8d354c7 100644
--- a/bluepymm/main.py
+++ b/bluepymm/main.py
@@ -1,20 +1,36 @@
from bluepymm import prepare_combos, run_combos, select_combos
-def _print_help():
- prepare_combos.print_help()
- print('')
- run_combos.print_help()
- print('')
- select_combos.print_help()
+def print_help(help_mode=None):
+ """Print help"""
+
+ if help_mode == "prepare":
+ prepare_combos.print_help()
+ elif help_mode == "run":
+ run_combos.print_help()
+ elif help_mode == "select":
+ select_combos.print_help()
+ else:
+ print("""Usage:
+
+ bluepymm <command>
+
+Commands:
+ prepare Prepare combos
+ run Run combos
+ select Select combos
+ help Show help for commands
+""")
+ if help_mode is not None:
+ print("ERROR: Unknown command: %s" % help_mode)
def main(arg_list):
"""Main"""
- print('\n##########################################################')
- print('# Starting BluePyMM: Blue Brain Project Model Management #')
- print('##########################################################\n')
+ print('\n######################################')
+ print('# Blue Brain Python Model Management #')
+ print('######################################\n')
if arg_list:
mode = arg_list[0]
@@ -25,10 +41,14 @@ def main(arg_list):
run_combos.main(arg_list[1:])
elif mode == "select":
select_combos.main(arg_list[1:])
- elif "help" in mode:
- _print_help()
+ elif mode == "help":
+ try:
+ help_mode = arg_list[1]
+ except IndexError:
+ help_mode = None
+ print_help(help_mode=help_mode)
else:
- print('Unknown command {}'.format(mode))
- print('Known commands are: help, prepare, run, select')
+ print_help()
+ print("ERROR: Unknown command: %s" % mode)
else:
- _print_help()
+ print_help()