diff options
author | Jon Ringle <jon@ringle.org> | 2010-03-22 23:06:39 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-03-23 21:08:55 +0100 |
commit | a21805982cd32135d616c0cddf5da99003edab17 (patch) | |
tree | 2b9dfdc92a88138f0a72273be420fb755e63890a | |
parent | 2cd4cf3e7e9ee7e0a68125dc91b0e57a80612ad8 (diff) | |
download | ptxdist-a21805982cd32135d616c0cddf5da99003edab17.tar.gz ptxdist-a21805982cd32135d616c0cddf5da99003edab17.tar.xz |
[ptxdist] Allow -- to stop parse_first option parsing
When trying to invoke a command via 'ptxdist bash cmd [args...]'
If cmd takes an argument that matches one of the option that is parsed in
parse_first in ptxdist, then cmd never gets that argument.
For example,
ptxdist bash foo -d bar
would get invoked as:
foo bar
This commit allows one to overcome this limitation:
ptxdist bash -- foo -d bar
so that it gets invoked properly as:
foo -d bar
Signed-off-by: Jon Ringle <jon@ringle.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rwxr-xr-x | bin/ptxdist | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 3b923d84f..7aa7633e8 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -1291,6 +1291,13 @@ parse_first() -q|--quiet) PTXDIST_QUIET=1 ;; + --) + while [ ${#} -ne 0 ]; do + arg="${1}" + shift + PTXDIST_ARGS_SECOND[${#PTXDIST_ARGS_SECOND[@]}]="${arg}" + done + ;; *) PTXDIST_ARGS_SECOND[${#PTXDIST_ARGS_SECOND[@]}]="${arg}" ;; |