Skip to content

Commit

Permalink
Only grab arguments for operators that take them
Browse files Browse the repository at this point in the history
  • Loading branch information
gabebw committed Dec 6, 2010
1 parent 53e7598 commit 7b08d05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions quest/input_handler.py
Expand Up @@ -104,9 +104,6 @@ def handle(user_input):
#print "** QUEST OPERATOR DETECTED **"
user_query_variable = quest_command_match.group(1)
quest_operator = quest_command_match.group(2)
arguments = quest_command_match.group(3).split(',')
# Turn "foo, bar" into ["foo", "bar"]
arguments = [str(arg).strip() for arg in arguments]

# Initialize to None in case we fail to set a valid +query+ below
query = None
Expand Down Expand Up @@ -143,6 +140,9 @@ def handle(user_input):
# Special handling because show takes no arguments
return query.show()
else:
arguments = quest_command_match.group(3).split(',')
# Turn "foo, bar" into ["foo", "bar"]
arguments = [str(arg).strip() for arg in arguments]
if arguments is None:
err_msg = "You must provide arguments to %s" % quest_operator
err_msg += "\nPlease use this syntax:"
Expand Down

0 comments on commit 7b08d05

Please sign in to comment.