Commit cd36b0a3 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Guard access to argv, fallback to the default action.

parent 05dbbf38
......@@ -105,9 +105,10 @@ class Application(object):
except Exception:
pass # TODO
subcommand = Config.DEFAULT_ACTION
if len(sys.argv):
try:
subcommand = sys.argv[1]
except IndexError:
subcommand = Config.DEFAULT_ACTION
if subcommand == 'add':
self.add()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment