Handle case when no argument has been specified.
This commit is contained in:
parent
b960e5810b
commit
c65e34b283
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue