Permalink
Browse files

Use `argparse.REMAINDER` instead of `+` to collect arguments.

  • Loading branch information...
rraval committed Jan 9, 2013
1 parent d55a52a commit 93d6465a427176bbd8660f1859dab6ff87be3cb4
Showing with 1 addition and 1 deletion.
  1. +1 −1 howdoi/howdoi.py
View
@@ -82,7 +82,7 @@ def howdoi(args):
def command_line_runner():
parser = argparse.ArgumentParser(description='code search tool')
- parser.add_argument('query', metavar='QUERY', type=str, nargs='+',
+ parser.add_argument('query', metavar='QUERY', type=str, nargs=argparse.REMAINDER,
help='the question to answer')
parser.add_argument('-p','--pos', help='select answer in specified position (default: 1)', default=1)
parser.add_argument('-a','--all', help='display the full text of the answer',

0 comments on commit 93d6465

Please sign in to comment.