Skip to content

Commit

Permalink
info, man, rsync: Defer _expand invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Mar 17, 2018
1 parent 6365265 commit add4e3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions completions/info
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ _info()
local cur prev words cword split
_init_completion -s || return

_expand || return

# default completion if parameter looks like a path
if [[ "$cur" == @(*/|[.~])* ]]; then
_filedir
Expand Down Expand Up @@ -49,6 +47,8 @@ _info()
infopath=$INFOPATH
fi

_expand || return

infopath=$infopath:
if [[ -n $cur ]]; then
infopath="${infopath//://$cur* }"
Expand Down
4 changes: 2 additions & 2 deletions completions/man
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ _man()
return
fi

_expand || return

# file based completion if parameter looks like a path
if [[ "$cur" == @(*/|[.~])* ]]; then
_filedir "$manext"
Expand All @@ -60,6 +58,8 @@ _man()
local sect
[[ "$prev" == $mansect ]] && sect=$prev || sect='*'

_expand || return

manpath=$manpath:
if [[ -n $cur ]]; then
manpath="${manpath//://*man$sect/$cur* } ${manpath//://*cat$sect/$cur* }"
Expand Down
4 changes: 2 additions & 2 deletions completions/rsync
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ _rsync()
local cur prev words cword split
_init_completion -s -n : || return

_expand || return

case $prev in
--config|--password-file|--include-from|--exclude-from|--files-from|\
--log-file|--write-batch|--only-write-batch|--read-batch)
Expand Down Expand Up @@ -34,6 +32,8 @@ _rsync()

$split && return

_expand || return

case $cur in
-*)
COMPREPLY=( $( compgen -W '--verbose --quiet --no-motd --checksum
Expand Down

0 comments on commit add4e3c

Please sign in to comment.