The utility methods CommandLineUtils.translateCommandline() currently splits arguments only at spaces:
|
StringTokenizer tok = new StringTokenizer(toProcess, "\"\' ", true); |
But for example the bash reference manual indicates that space, tab and newline is considered as separator:
https://www.gnu.org/software/bash/manual/bash.html#Word-Splitting-1
If IFS is unset, word splitting behaves as if its value were <space><tab><newline>, and treats these characters as IFS whitespace.
As far as I can tell, Windows cmd behaves similar with respect to tab. I'm not sure about powershell.
Especially not being able to use tabs, can make using this difficult in CI environments.
Would you be willing to accept a patch to enhance this method to split at least on tabs too, maybe even newline (\n and \r)?
Or at least an overload that allows custom separators or a second method with this extended list of separator chars?
I can provider corresponding PRs.
The utility methods
CommandLineUtils.translateCommandline()currently splits arguments only at spaces:plexus-utils/src/main/java/org/codehaus/plexus/util/cli/CommandLineUtils.java
Line 359 in e9f14be
But for example the bash reference manual indicates that
space,tabandnewlineis considered as separator:https://www.gnu.org/software/bash/manual/bash.html#Word-Splitting-1
As far as I can tell, Windows
cmdbehaves similar with respect to tab. I'm not sure aboutpowershell.Especially not being able to use tabs, can make using this difficult in CI environments.
Would you be willing to accept a patch to enhance this method to split at least on tabs too, maybe even newline (
\nand\r)?Or at least an overload that allows custom separators or a second method with this extended list of separator chars?
I can provider corresponding PRs.