xtream1101 / humblebundle-downloader

Download you Humble Bundle Library
MIT License
543 stars 63 forks source link

Fix crash if no arguments are passed to CLI #48

Closed shane-kerr closed 2 months ago

shane-kerr commented 2 years ago

Invoking hbd without any arguments results in a crash:

$ hbd
Traceback (most recent call last):
  File "/home/shane/.local/bin/hbd", line 8, in <module>
    sys.exit(cli())
  File "/home/shane/.local/lib/python3.9/site-packages/humblebundle_downloader/cli.py", line 81, in cli
    cli_args = parse_args(sys.argv[1:])
  File "/home/shane/.local/lib/python3.9/site-packages/humblebundle_downloader/cli.py", line 18, in parse_args
    if args[0].lower() == 'download':
IndexError: list index out of range

This PR should fix that. It's a simple 1-line fix. Also included is a test.