Handle case when no argument has been specified.

This commit is contained in:
Martin Brodbeck 2018-01-30 12:03:25 +01:00
parent b960e5810b
commit c65e34b283

View file

@ -154,6 +154,10 @@ def main():
parser_list = subparsers.add_parser('list', help='List all known stations') parser_list = subparsers.add_parser('list', help='List all known stations')
parser_list.set_defaults(func=list) 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 = parser.parse_args()
args.func(args) args.func(args)