diff options
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Base/_arguments | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index d2b276cf0..5925cbc42 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -43,10 +43,9 @@ if [[ "$*" != "$_args_cache_descr" ]]; then tmpargv=( "${(@)argv[1,nth-1]}" ) fi - if [[ "$words[1]" = /* ]]; then - tmp="$words[1]" - else - tmp="$PWD/$words[1]" + tmp=${~words[1]} + if [[ "$tmp" != /* ]]; then + tmp="$PWD/$tmp" fi if [[ "$tmp" != "$_args_cache_longcmd" ]]; then @@ -92,7 +91,7 @@ if [[ "$*" != "$_args_cache_descr" ]]; then # those hyphens and anything from the space or comma after the # option up to the end. - lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$("$words[1]" --help 2>&1)//\[--/ + lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(${~words[1]} --help 2>&1)//\[--/ --}:#[ ]#-*}//,/ }}:#[ ]#--*}#*--}%%[, ]*}:#}") |