From c65e34b283545df606c730ad59d91dc02ee46905 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 30 Jan 2018 12:03:25 +0100 Subject: [PATCH] Handle case when no argument has been specified. --- radiorec.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/radiorec.py b/radiorec.py index e2f6b0e..fb24e3c 100755 --- a/radiorec.py +++ b/radiorec.py @@ -154,6 +154,10 @@ def main(): parser_list = subparsers.add_parser('list', help='List all known stations') parser_list.set_defaults(func=list) + if not len(sys.argv) > 1: + print('Error: No argument specified.\n') + parser.print_help() + sys.exit(1) args = parser.parse_args() args.func(args)