Commit d5356666 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Properly parse command line options with empty arguments, eg. "foo||bar"

parent 4a3e0468
......@@ -150,7 +150,7 @@ def _main():
"""this parses the command line argument in 'arg' and calls the
underlying function"""
# Parameter regexp
p = re.compile(r"((('[^']*')|(\"[^\"']*\"))|([^\|]+)|(^(?=[^$]))(?=\||$))")
p = re.compile(r"((('[^']*')|(\"[^\"']*\"))|([^\|]+)|(\B)|(^(?=[^$]))(?=\||$))")
if arg == None:
arg = ""
values = [x[0].strip() for x in p.findall(arg)]
Supports Markdown
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