diff --git a/larigira/event_manage.py b/larigira/event_manage.py index 991168a..7bbf09a 100644 --- a/larigira/event_manage.py +++ b/larigira/event_manage.py @@ -11,6 +11,7 @@ def main_list(args): m = EventModel(args.file) for alarm, action in m.get_all_alarms_expanded(): json.dump(dict(alarm=alarm, action=action), sys.stdout, indent=4) + sys.stdout.write('\n') def main_getaction(args): @@ -29,6 +30,7 @@ def main_add(args): def main(): conf = get_conf() p = argparse.ArgumentParser() + p.set_defaults(func=None) p.add_argument( "-f", "--file", help="Filepath for DB", required=False, default=conf["DB_URI"] ) @@ -45,6 +47,9 @@ def main(): sub_add.set_defaults(func=main_add) args = p.parse_args() + if args.func is None: + p.print_help() + sys.exit(2) args.func(args)