Comma treated as special by parse_commandline, but not by shell_quote
Issue #34
resolved
sarge.parse_command_line(sarge.shell_format("ls {0}", "foo,bar"))
results in
CommandNode(command=['ls', 'foo', ',', 'bar'] redirects={})
which causes
sarge.run("ls foo,bar")
ls: cannot access foo: No such file or directory
ls: cannot access ,: No such file or directory
ls: cannot access bar: No such file or directory
Whereas my shell does the following:
ls foo,bar
ls: cannot access foo,bar: No such file or directory
I initially found this issue when trying to run commands with comma-separated options:
sarge.run(foo --output-format=txt,json,xml)
which would cause it to run foo --output-format=txt foo bar
Comments (2)
-
repo owner -
repo owner - changed status to resolved
Fixes
#34: Added/updated test.→ <<cset b624f40f62a9>>
- Log in to comment
Note that this is how
shlex.shlex
parses that command-line:The tokenisation done by
sarge
uses asubclass ofshlex.shlex
, which is why it parses the same way.