diff options
Diffstat (limited to 'Completion/Base')
-rw-r--r-- | Completion/Base/Utility/_arguments | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index 05a287a5f..a87486168 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -5,6 +5,7 @@ local long cmd="$words[1]" descr mesg subopts opt usecc autod local oldcontext="$curcontext" hasopts rawret optarg singopt alwopt +local setnormarg long=$argv[(I)--] if (( long )); then @@ -189,12 +190,13 @@ fi subopts=() singopt=() -while [[ "$1" = -(O*|[CRWsw]) ]]; do +while [[ "$1" = -(O*|[CRWnsw]) ]]; do case "$1" in -C) usecc=yes; shift ;; -O) subopts=( "${(@P)2}" ); shift 2 ;; -O*) subopts=( "${(@P)${1[3,-1]}}" ); shift ;; -R) rawret=yes; shift;; + -n) setnormarg=yes; NORMARG=-1; shift;; -w) optarg=yes; shift;; -s) singopt=(-s); shift;; -W) alwopt=arg; shift;; @@ -251,6 +253,10 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then descr="$descrs[anum]" subc="$subcs[anum++]" + if [[ $subc = argument* && -n $setnormarg ]]; then + comparguments -n NORMARG + fi + if [[ -n "$matched" ]] || _requested "$subc"; then curcontext="${oldcontext%:*}:$subc" |