@@ -624,7 +624,7 @@ _filedir()
624624 local opts=(-f -X " $xspec " )
625625 [[ $xspec ]] && plusdirs=(-o plusdirs)
626626 [[ ${BASH_COMPLETION_FILEDIR_FALLBACK-${COMP_FILEDIR_FALLBACK-} } ||
627- -z ${plusdirs-} ]] ||
627+ ! ${plusdirs-} ]] ||
628628 opts+=(" ${plusdirs[@]} " )
629629
630630 reset=$( shopt -po noglob)
@@ -636,7 +636,7 @@ _filedir()
636636
637637 # Try without filter if it failed to produce anything and configured to
638638 [[ ${BASH_COMPLETION_FILEDIR_FALLBACK-${COMP_FILEDIR_FALLBACK-} } &&
639- -n $arg && ${# toks[@]} -lt 1 ]] && {
639+ $arg && ${# toks[@]} -lt 1 ]] && {
640640 reset=$( shopt -po noglob)
641641 set -o noglob
642642 toks+=($( compgen -f ${plusdirs+" ${plusdirs[@]} " } -- $quoted ) )
@@ -1567,7 +1567,7 @@ _fstypes()
15671567 $( [[ -d /etc/fs ]] && command ls /etc/fs) "
15681568 fi
15691569
1570- [[ -n $fss ]] && COMPREPLY+=($( compgen -W " $fss " -- " $cur " ) )
1570+ [[ $fss ]] && COMPREPLY+=($( compgen -W " $fss " -- " $cur " ) )
15711571}
15721572
15731573# Get real command.
@@ -1952,7 +1952,7 @@ _known_hosts_real()
19521952
19531953 # Add results of normal hostname completion, unless
19541954 # `BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value.
1955- if [[ -n ${BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE-${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1} } ]]; then
1955+ if [[ ${BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE-${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1} } ]]; then
19561956 COMPREPLY+=(
19571957 $( compgen -A hostname -P " $prefix " -S " $suffix " -- " $cur " ) )
19581958 fi
@@ -1993,7 +1993,7 @@ _cd()
19931993
19941994 # Use standard dir completion if no CDPATH or parameter starts with /,
19951995 # ./ or ../
1996- if [[ -z ${CDPATH:- } || $cur == ? (.)? (.)/* ]]; then
1996+ if [[ ! ${CDPATH:- } || $cur == ? (.)? (.)/* ]]; then
19971997 _filedir -d
19981998 return
19991999 fi
@@ -2136,7 +2136,7 @@ _command_offset()
21362136 # Note: When completion spec is removed after 124, we do
21372137 # not generate any completions including the default ones.
21382138 # This is the behavior of the original Bash progcomp.
2139- [[ -n $cspec ]] || break
2139+ [[ $cspec ]] || break
21402140
21412141 continue
21422142 fi
@@ -2267,7 +2267,7 @@ _filedir_xspec()
22672267 toks+=($(
22682268 eval compgen -f -X " '!$xspec '" -- ' $(quote_readline "$cur")' | {
22692269 while read -r tmp; do
2270- [[ -n $tmp ]] && printf ' %s\n' $tmp
2270+ [[ $tmp ]] && printf ' %s\n' $tmp
22712271 done
22722272 }
22732273 ) )
@@ -2372,7 +2372,7 @@ __load_completion()
23722372{
23732373 local -a dirs=(${BASH_COMPLETION_USER_DIR:- ${XDG_DATA_HOME:- $HOME / .local/ share} / bash-completion} /completions)
23742374 local IFS=: dir cmd=" ${1##*/ } " compfile
2375- [[ -n $cmd ]] || return 1
2375+ [[ $cmd ]] || return 1
23762376 for dir in ${XDG_DATA_DIRS:-/ usr/ local/ share:/ usr/ share} ; do
23772377 dirs+=($dir /bash-completion/completions)
23782378 done
0 commit comments