Use == instead of =.
parent
9852597d8c
commit
497c20902a
|
@ -136,7 +136,7 @@ have()
|
|||
#
|
||||
_rl_enabled()
|
||||
{
|
||||
[[ "$( bind -v )" = *$1+([[:space:]])on* ]]
|
||||
[[ "$( bind -v )" == *$1+([[:space:]])on* ]]
|
||||
}
|
||||
|
||||
# This function shell-quotes the argument
|
||||
|
@ -1172,10 +1172,10 @@ _installed_modules()
|
|||
# context of current completion.
|
||||
_usergroup()
|
||||
{
|
||||
if [[ $cur = *\\\\* || $cur = *:*:* ]]; then
|
||||
if [[ $cur == *\\\\* || $cur == *:*:* ]]; then
|
||||
# Give up early on if something seems horribly wrong.
|
||||
return
|
||||
elif [[ $cur = *\\:* ]]; then
|
||||
elif [[ $cur == *\\:* ]]; then
|
||||
# Completing group after 'user\:gr<TAB>'.
|
||||
# Reply with a list of groups prefixed with 'user:', readline will
|
||||
# escape to the colon.
|
||||
|
@ -1190,7 +1190,7 @@ _usergroup()
|
|||
COMPREPLY=( $( compgen -g -- "$mycur" ) )
|
||||
fi
|
||||
COMPREPLY=( $( compgen -P "$prefix" -W "${COMPREPLY[@]}" ) )
|
||||
elif [[ $cur = *:* ]]; then
|
||||
elif [[ $cur == *:* ]]; then
|
||||
# Completing group after 'user:gr<TAB>'.
|
||||
# Reply with a list of unprefixed groups since readline with split on :
|
||||
# and only replace the 'gr' part
|
||||
|
|
|
@ -131,7 +131,7 @@ _cvs()
|
|||
mode=version
|
||||
;;
|
||||
esac
|
||||
elif [[ "$i" = -* ]]; then
|
||||
elif [[ "$i" == -* ]]; then
|
||||
flags+=( $i )
|
||||
fi
|
||||
count=$((++count))
|
||||
|
@ -187,7 +187,7 @@ _cvs()
|
|||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
_cvs_command_options "$1" $mode
|
||||
else
|
||||
_cvs_entries
|
||||
|
@ -197,7 +197,7 @@ _cvs()
|
|||
annotate)
|
||||
[[ "$prev" == -@(r|D) ]] && return 0
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
_cvs_command_options "$1" $mode
|
||||
else
|
||||
_cvs_entries
|
||||
|
@ -274,7 +274,7 @@ _cvs()
|
|||
fi
|
||||
;;
|
||||
editors|watchers)
|
||||
if [[ "$cur" = -* ]]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
_cvs_command_options "$1" $mode
|
||||
else
|
||||
_cvs_entries
|
||||
|
@ -356,7 +356,7 @@ _cvs()
|
|||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
_cvs_command_options "$1" $mode
|
||||
else
|
||||
_cvs_entries
|
||||
|
|
|
@ -35,7 +35,7 @@ _dict()
|
|||
esac
|
||||
done
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
|
|
@ -67,7 +67,7 @@ _find()
|
|||
local i exprfound=false
|
||||
# set exprfound to true if there is already an expression present
|
||||
for i in ${words[@]}; do
|
||||
[[ "$i" = [-\(\),\!]* ]] && exprfound=true && break
|
||||
[[ "$i" == [-\(\),\!]* ]] && exprfound=true && break
|
||||
done
|
||||
|
||||
# handle case where first parameter is not a dash option
|
||||
|
|
|
@ -23,7 +23,7 @@ _iconv()
|
|||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
||||
return 0
|
||||
|
|
|
@ -7,7 +7,7 @@ _ipsec_connections()
|
|||
{
|
||||
local keyword name
|
||||
while read -r keyword name; do
|
||||
if [[ $keyword = [#]* ]]; then continue; fi
|
||||
if [[ $keyword == [#]* ]]; then continue; fi
|
||||
[[ $keyword == conn && $name != '%default' ]] && COMPREPLY+=( "$name" )
|
||||
done
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
|
||||
|
|
|
@ -94,7 +94,7 @@ _lintian()
|
|||
--root"
|
||||
selection_opts="--all --binary --source --udeb --packages-file"
|
||||
|
||||
if [[ "$prev" = -* ]]; then
|
||||
if [[ "$prev" == -* ]]; then
|
||||
case $prev in
|
||||
-C|--check-part|-X|--dont-check-part)
|
||||
_lintian_checks
|
||||
|
|
|
@ -33,14 +33,14 @@ _pkg-get()
|
|||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ "${prev}" = "-s" ]]; then
|
||||
if [[ "${prev}" == "-s" ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
i=${#COMP_WORDS[*]}
|
||||
while [[ $i -gt 0 ]]; do
|
||||
i=$((i-1))
|
||||
if [[ "${COMP_WORDS[$i]}" = "-s" ]]; then
|
||||
if [[ "${COMP_WORDS[$i]}" == -s ]]; then
|
||||
url="${COMP_WORDS[$((i+1))]}"
|
||||
fi
|
||||
if [[ "${COMP_WORDS[$i]}" == @(available|-a|describe|-D|download|-d|install|-i|list|updatecatalog|-U|upgrade|-u) ]]; then
|
||||
|
|
|
@ -23,34 +23,34 @@ _pkgutil()
|
|||
|
||||
i=$cword
|
||||
while [[ $((i--)) -gt 1 ]]; do
|
||||
if [[ "${words[$i]}" = @(-t|--temp) ]]; then
|
||||
if [[ "${words[$i]}" == @(-t|--temp) ]]; then
|
||||
local url="${words[$((i+1))]}"
|
||||
local catalog=$(_pkgutil_url2catalog "$url")
|
||||
catalog_files=("$catalog")
|
||||
elif [[ "${words[$i]}" = @(--config) ]]; then
|
||||
elif [[ "${words[$i]}" == --config ]]; then
|
||||
configuration_files=( "$(dequote ${words[$((i+1))]})" )
|
||||
elif [[ "${words[$i]}" == @(-i|--install|-u|--upgrade|-r|--remove|-d|--download|-a|--available|-c|--compare|-U|--catalog|-S|--stream) ]]; then
|
||||
command="${words[$i]}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$prev" = @(-W|--workdir|-P|--pkgdir|-R|--rootpath) ]]; then
|
||||
if [[ "$prev" == @(-W|--workdir|-P|--pkgdir|-R|--rootpath) ]]; then
|
||||
_filedir -d
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "$prev" = @(-o|--output|--config) ]]; then
|
||||
if [[ "$prev" == @(-o|--output|--config) ]]; then
|
||||
_filedir
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "$prev" = @(-p|--param) ]]; then
|
||||
if [[ "$prev" == @(-p|--param) ]]; then
|
||||
compopt -o nospace
|
||||
COMPREPLY=( $(compgen -W "mirror: pkgaddopts: pkgrmopts: wgetopts: use_gpg: use_md5: pkgliststyle: maxpkglist: noncsw: stop_on_hook_soft_error: exclude_pattern: gpg_homedir: root_path: deptree_filter_common: show_current: catalog_not_cached: catalog_update:" -- $cur) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "$prev" = @(-T|--target) ]]; then
|
||||
if [[ "$prev" == @(-T|--target) ]]; then
|
||||
# Work-around bash_completion issue where bash interprets a colon
|
||||
# as a separator, borrowed from maven completion code which borrowed
|
||||
# it from darcs completion code :)
|
||||
|
|
|
@ -19,7 +19,7 @@ _postcat()
|
|||
|
||||
local idx qfile=0
|
||||
for idx in "${words[@]}"; do
|
||||
[[ "$idx" = -q ]] && qfile=1 && break
|
||||
[[ "$idx" == -q ]] && qfile=1 && break
|
||||
done
|
||||
if [[ $qfile -eq 1 ]]; then
|
||||
local len=${#cur} pval
|
||||
|
|
|
@ -21,7 +21,7 @@ _puppet_certs()
|
|||
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetca &>/dev/null \
|
||||
&& puppetca=puppetca
|
||||
|
||||
if [[ "$1" = '--all' ]]; then
|
||||
if [[ "$1" == --all ]]; then
|
||||
cert_list=$( $puppetca --list --all | sed -e 's/^[+-]\?\s*\(\S\+\)\s\+.*$/\1/' )
|
||||
else
|
||||
cert_list=$( $puppetca --list )
|
||||
|
|
|
@ -46,7 +46,7 @@ _linux_fstab()
|
|||
local fs_spec fs_file fs_other
|
||||
local oldifs="$IFS"
|
||||
while read -r fs_spec fs_file fs_other; do
|
||||
if [[ $fs_spec = [#]* ]]; then continue; fi
|
||||
if [[ $fs_spec == [#]* ]]; then continue; fi
|
||||
if [[ $1 == -L ]]; then
|
||||
local fs_label=${fs_spec/#LABEL=}
|
||||
if [[ $fs_label != "$fs_spec" ]]; then
|
||||
|
@ -59,8 +59,8 @@ _linux_fstab()
|
|||
__linux_fstab_unescape fs_spec
|
||||
__linux_fstab_unescape fs_file
|
||||
IFS=$'\0'
|
||||
[[ $fs_spec = */* ]] && COMPREPLY+=("$fs_spec")
|
||||
[[ $fs_file = */* ]] && COMPREPLY+=("$fs_file")
|
||||
[[ $fs_spec == */* ]] && COMPREPLY+=("$fs_spec")
|
||||
[[ $fs_file == */* ]] && COMPREPLY+=("$fs_file")
|
||||
IFS=$oldifs
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue