[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.1-7-g497c209
Ville Skyttä
ville.skytta at iki.fi
Mon Apr 8 20:04:16 UTC 2013
The following commit has been merged in the master branch:
commit 497c20902a978098512674bbaa37a839e355c782
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Mon Apr 8 23:04:11 2013 +0300
Use == instead of =.
diff --git a/bash_completion b/bash_completion
index e7c393e..cb7aba1 100644
--- a/bash_completion
+++ b/bash_completion
@@ -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
diff --git a/completions/cvs b/completions/cvs
index f470a1b..9d448d0 100644
--- a/completions/cvs
+++ b/completions/cvs
@@ -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
diff --git a/completions/dict b/completions/dict
index a2ecd9b..469b222 100644
--- a/completions/dict
+++ b/completions/dict
@@ -35,7 +35,7 @@ _dict()
esac
done
- if [[ "$cur" = -* ]]; then
+ if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
return 0
fi
diff --git a/completions/find b/completions/find
index 1896fc2..78e16f4 100644
--- a/completions/find
+++ b/completions/find
@@ -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
diff --git a/completions/iconv b/completions/iconv
index b33cc70..52d5d9f 100644
--- a/completions/iconv
+++ b/completions/iconv
@@ -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
diff --git a/completions/ipsec b/completions/ipsec
index b1161b0..7b87ce9 100644
--- a/completions/ipsec
+++ b/completions/ipsec
@@ -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" ) )
diff --git a/completions/lintian b/completions/lintian
index 1c9eaa6..85a91f8 100644
--- a/completions/lintian
+++ b/completions/lintian
@@ -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
diff --git a/completions/pkg-get b/completions/pkg-get
index bf66fcc..6933906 100644
--- a/completions/pkg-get
+++ b/completions/pkg-get
@@ -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
diff --git a/completions/pkgutil b/completions/pkgutil
index 06bbeaf..5e31b00 100644
--- a/completions/pkgutil
+++ b/completions/pkgutil
@@ -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 :)
diff --git a/completions/postcat b/completions/postcat
index c601cb0..afc1873 100644
--- a/completions/postcat
+++ b/completions/postcat
@@ -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
diff --git a/completions/puppet b/completions/puppet
index f24917a..be686e3 100644
--- a/completions/puppet
+++ b/completions/puppet
@@ -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 )
diff --git a/completions/umount.linux b/completions/umount.linux
index 9bc9fcc..d66c99f 100644
--- a/completions/umount.linux
+++ b/completions/umount.linux
@@ -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
--
bash-completion
More information about the Bash-completion-commits
mailing list