Skip to content

Commit

Permalink
Consider version and daemon flag on base argparser. Closes #424
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Jul 13, 2018
1 parent 10474d6 commit 890fdd5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ipwb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,14 @@ def checkArgs(argsIn):

argCount = len(argsIn)
cmdList = ['index', 'replay']
baseParserFlagList = ['-d', '--daemon', '-v', '--version']

# Various invocation error, used to show appropriate help
cmdError_index = argCount == 2 and argsIn[1] == 'index'
cmdError_noCommand = argCount == 1
cmdError_invalidCommand = argCount > 1 and argsIn[1] not in cmdList
cmdError_invalidCommand = argCount > 1 \
and argsIn[1] not in cmdList \
and argsIn[1] not in baseParserFlagList

if cmdError_noCommand or cmdError_invalidCommand:
parser.print_help()
Expand Down

0 comments on commit 890fdd5

Please sign in to comment.