diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-04-02 15:09:44 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-04-02 15:09:44 +0200 |
commit | f27f579358d2c12fc3926bfd5bb95ef3e08ca6a7 (patch) | |
tree | 7d7c6dcb3aaaf7d6b39d05a9670bfe6d23e5dc9a /tests | |
parent | fcaeaa235b10a6f7acaa32c8698680ec97076b07 (diff) |
Handle combined option values in argv_file_scanner
Turns out we cannot just pass them along as combined because of quoting.
While at it, also add support for quoting non-option arguments.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/combined/testscript | 33 | ||||
-rw-r--r-- | tests/file/testscript | 11 |
2 files changed, 40 insertions, 4 deletions
diff --git a/tests/combined/testscript b/tests/combined/testscript index aaa1bea..83eb00e 100644 --- a/tests/combined/testscript +++ b/tests/combined/testscript @@ -37,10 +37,35 @@ : options-file : - cat <<EOI >=options; - --foo=123 - EOI - $* --file=options >'--foo=123' + { + : basics + : + cat <<EOI >=options; + --foo=123 + EOI + $* --file=options >'--foo=123' + + : equal-in-value + : + cat <<EOI >=options; + --foo bar=123 + EOI + $* --file=options >'--foo=bar=123' + + : space-in-value + : + cat <<EOI >=options; + --foo= 123 + EOI + $* --file=options >'--foo= 123' + + : quoted-value + : + cat <<EOI >=options; + --foo="'bar 123'" + EOI + $* --file=options >"--foo='bar 123'" + } } : flags diff --git a/tests/file/testscript b/tests/file/testscript index 4cf35e2..3f9d43b 100644 --- a/tests/file/testscript +++ b/tests/file/testscript @@ -239,3 +239,14 @@ EOI $* --file test.cli 2>>EOE unmatched quote in argument ''abc"' EOE + +: quoted-argument +: +cat <<EOI >=test.cli; +"'foo bar'" +'"foo bar"' +EOI +$* --file test.cli >>EOO +'foo bar' +"foo bar" +EOO |