Skip to content

Commit

Permalink
remove quotes before calling --custom command, fix #49
Browse files Browse the repository at this point in the history
  • Loading branch information
vikstrous committed May 21, 2015
1 parent 09f7f24 commit b165eb1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pirate-get.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ def parse_cmd(cmd, url):
cmd_args_regex = r'''(('[^']*'|"[^"]*"|(\\\s|[^\s])+)+ *)'''
ret = re.findall(cmd_args_regex, cmd)
ret = [i[0].strip().replace('%s', url) for i in ret]
return ret
ret_no_quotes = []
for item in ret:
if (item[0] == "'" and item[-1] == "'") or (item[0] == '"' and item[-1] == '"'):
ret_no_quotes.append(item[1:-1])
else:
ret_no_quotes.append(item)
return ret_no_quotes


#todo: redo this with html parser instead of regex
Expand Down

0 comments on commit b165eb1

Please sign in to comment.