10 Commits

Author SHA1 Message Date
Ingo Karkat 3980e83c1b FIX: ingo#cmdargs#file#FileOptionsAndCommandsToEscapedExCommandLine(): Unescape cmdline-special symbols and backslashes first
cmdline-special symbols (%, #, <) and backslashes may have been escaped already. These escapings must not be doubled, so unescape them first, so that cmdline-special symbols stand on their own, and a double backslash remains as it was passed.
2020-09-18 20:24:34 +02:00
Ingo Karkat 721aa15f57 ingo#cmdargs#file#FileOptionsAndCommandsToEscapedExCommandLine(): Avoid side effect of escaping the passed-in List
Some clients may want to keep using the original List, too.
2018-09-26 10:14:10 +02:00
Ingo Karkat 160636da75 Tests: Renaming: Clarify test subject, avoid identical test names 2018-09-26 10:08:55 +02:00
Ingo Karkat 752b12b1e6 Add ingo#cmdargs#file#FilterFileOptionsToEscaped() and ingo#cmdargs#file#FilterFileOptionsAndCommandsToEscaped()
Most of my clients will use ingo#cmdargs#file#FilterFileOptionsAndCommandsToEscaped(), but because at least one needs the fileOptionsAndCommand as either unescaped List or escaped joined String, I keep the others, too.
The added functions include a litte optimization for the common case of no passed options and commands.
2018-09-26 09:04:06 +02:00
Ingo Karkat 25c9a303cd Add ingo#cmdargs#file#FileOptionsAndCommandsToEscapedExCommandLine()
Its implementation has been suggested by ingo#cmdargs#file#FilterFileOptionsAndCommands(), and most of my clients need this (but sometimes also the raw List, so I can't just change the default return value or make this configurable via a flag).
2018-09-25 16:43:03 +02:00
Ingo Karkat 80bcde6d82 ENH: Add ingo#cmdargs#file#FilterFileOptions() variant of ingo#cmdargs#file#FilterFileOptionsAndCommands() 2018-09-25 16:31:30 +02:00
Ingo Karkat 8974c36e0e Tests: Add coverage for modification of original argument list 2018-09-25 16:24:48 +02:00
Ingo Karkat 176d75a2ab Refactoring: Extract s:fileOptionsExpr and use for stricter checking in ingo#cmdargs#file#FilterFileOptionsAndCommands(), too 2018-09-24 15:22:35 +02:00
Ingo Karkat 22a6e66c2f ingo#cmdargs#file#FilterFileOptionsAndCommands(): Reimplement
By using the new ingo#list#split#RemoveFromStartWhilePredicate(), we can drastically simplify the implementation and fix the parsing bug with option(s) after command.
2018-09-24 15:10:20 +02:00
Ingo Karkat 0314ac3de3 Tests: Add coverage of ingo#cmdargs#file#FilterFileOptionsAndCommands()
The tests also exposed a bug in the parsing. I'll address that with a reimplementation.
2018-09-24 13:56:13 +02:00