Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

User operator = instead of ==

This is shell, not C, dammit
  • Loading branch information...
commit e9dd843905fd2f193dcf26de1db1b6032cb772f8 1 parent a777f7c
Daniel Luz authored
4 completion-bundle
View
@@ -16,13 +16,13 @@ __bundle() {
COMPREPLY=()
local options
- if [[ $cur == -* ]]; then
+ if [[ $cur = -* ]]; then
options="--no-color --verbose"
if [[ -z $bundle_command ]]; then
options="$options --version --help"
fi
else
- if [[ -z $bundle_command || $bundle_command == help ]]; then
+ if [[ -z $bundle_command || $bundle_command = help ]]; then
options="help install update package exec config check list show
console open viz init gem"
fi
10 completion-gem
View
@@ -18,19 +18,19 @@ __gem() {
__gem_get_command
# can't do anything with non-commands
- [[ $gem_command == - ]] && return
+ [[ $gem_command = - ]] && return
- if [[ $prev == --config-file ]]; then
+ if [[ $prev = --config-file ]]; then
# leave COMPREPLY blank, let the default handle it
return
- elif [[ $prev == --*dir || ${COMP_WORDS[$COMP_CWORD]} == --*dir=* ]]; then
+ elif [[ $prev = --*dir || ${COMP_WORDS[$COMP_CWORD]} = --*dir=* ]]; then
# assume any option ending in 'dir' takes a directory name
type -t _filedir >/dev/null && _filedir -d "$cur"
return
fi
local choices
- if [[ $cur == -* ]]; then
+ if [[ $cur = -* ]]; then
case $gem_command in
"")
choices="-h --help -v --version";;
@@ -73,7 +73,7 @@ __gem_get_command() {
# keep scanning; if a "--" is found, treat the command as finished
for ((++i; i < $COMP_CWORD; ++i)); do
- if [[ ${COMP_WORDS[$i]} == -- ]]; then
+ if [[ ${COMP_WORDS[$i]} = -- ]]; then
gem_command=-
return
fi
4 completion-jruby
View
@@ -48,7 +48,7 @@ __jruby() {
esac
done
- if [[ $switches_accepted && $cur == -* ]]; then
+ if [[ $switches_accepted && $cur = -* ]]; then
COMPREPLY=($(compgen -W "$options" -- "$cur"))
elif [[ $script_in_path && ! $script_given ]]; then
local jruby_dir=$(dirname "$(which "$cmd")" 2>/dev/null)
@@ -60,7 +60,7 @@ __jruby() {
fi
# include `ruby` completion results, if available
- if [[ $(type -t __ruby) == function ]]; then
+ if [[ $(type -t __ruby) = function ]]; then
local cr=("${COMPREPLY[@]}")
__ruby "$@"
COMPREPLY+=("${cr[@]}")
18 completion-rails
View
@@ -11,7 +11,7 @@
__rails() {
if [[ -z $__RAILS_VERSION ]]; then
local ver=$(rails --version 2>/dev/null)
- if [[ $ver == "Rails 2."* ]]; then
+ if [[ $ver = "Rails 2."* ]]; then
__RAILS_VERSION=__rails2
else
__RAILS_VERSION=__rails3
@@ -66,7 +66,7 @@ __rails3() {
__rails_complete_environments "$cur"
return;;
--mode)
- if [[ $cmd == dbconsole || $cmd == db ]]; then
+ if [[ $cmd = dbconsole || $cmd = db ]]; then
local options="html list line column"
COMPREPLY=($(compgen -W "$options" -- "$cur"))
return
@@ -75,7 +75,7 @@ __rails3() {
esac
local options
- if [[ $cur == -* ]]; then
+ if [[ $cur = -* ]]; then
if [[ -z $cmd ]]; then
options="-h --help -v --version"
else
@@ -125,7 +125,7 @@ __rails2() {
return;;
esac
- if [[ $cur == -* ]]; then
+ if [[ $cur = -* ]]; then
local options="
-r --ruby -d --database -f --freeze -v --version -h --help -p --pretend
--force -s --skip -q --quiet -t --backtrace -c --svn -g --git"
@@ -143,7 +143,7 @@ __rails2_script_server() {
__rails_complete_environments "$cur"
return;;
*)
- if [[ $cur == -* ]]; then
+ if [[ $cur = -* ]]; then
local options="
-p --port -b --binding -d --daemon -u --debugger -e --environment"
COMPREPLY=($(compgen -W "$options" -- "$cur"))
@@ -155,10 +155,10 @@ __rails2_script_console() {
local cur=$2
local prev=$3
COMPREPLY=()
- if [[ $cur == -* ]]; then
+ if [[ $cur = -* ]]; then
local options="-s --sandbox --irb --debugger"
COMPREPLY=($(compgen -W "$options" -- "$cur"))
- elif [[ $prev == --irb ]]; then
+ elif [[ $prev = --irb ]]; then
COMPREPLY=($(compgen -A command -- "$cur"))
else
__rails_complete_environments "$cur"
@@ -169,12 +169,12 @@ __rails2_script_generate() {
local cur=$2
local prev=$3
COMPREPLY=()
- if [[ $cur == -* ]]; then
+ if [[ $cur = -* ]]; then
local options="
-v --version -h --help -p --pretend -f --force -s --skip
-q --quiet -t --backtrace -c --svn -g --git"
COMPREPLY=($(compgen -W "$options" -- "$cur"))
- elif [[ $(__rails_get_command) == "" ]]; then
+ elif [[ $(__rails_get_command) = "" ]]; then
__rails2_complete_generators "$cur"
fi
}
10 completion-rake
View
@@ -29,14 +29,14 @@ __rake() {
fi
return;;
*)
- if [[ $cur == -* ]]; then
+ if [[ $cur = -* ]]; then
local options="
-C --classic-namespace -D --describe -n --dry-run -h --help
-I --libdir -N --nosearch -P --prereqs -q --quiet -f --rakefile
-R --rakelibdir -r --require -s --silent -T --tasks -t --trace
-v --verbose -V --version"
COMPREPLY=($(compgen -W "$options" -- "$cur"))
- elif [[ $cur == *'['* ]]; then
+ elif [[ $cur = *'['* ]]; then
# parameter completion (using default compgen)
# $cur: example[param1,param2
# $args: param1,param2
@@ -78,7 +78,7 @@ __rake() {
# namespaced tasks. This function removes whatever the user already typed
# until the last colon.
__rake_remove_namespaces() {
- if [[ $cur == *:* ]]; then
+ if [[ $cur = *:* ]]; then
local prefix=${cur%:*}:
COMPREPLY=("${COMPREPLY[@]#"$prefix"}")
fi
@@ -125,7 +125,7 @@ __rake_get_rakefile() {
fi
done
cd ..
- [[ $(pwd) == / ]] && break
+ [[ $(pwd) = / ]] && break
done
popd >/dev/null
@@ -152,7 +152,7 @@ __rake_tasks() {
local tasks
if [[ $cachefile -nt $rakefile &&
- $(head -n 1 -- "$cachefile") == $rakefile ]]; then
+ $(head -n 1 -- "$cachefile") = $rakefile ]]; then
tail -n +2 -- "$cachefile"
else
[[ -d $rakedir ]] && cd "$rakedir"
4 completion-ruby
View
@@ -40,7 +40,7 @@ __ruby() {
switches_accepted=""
script_given=1;;
-C | -I)
- [[ $COMP_CWORD == $((i + 1)) ]] && complete_dirs=1
+ [[ $COMP_CWORD = $((i + 1)) ]] && complete_dirs=1
((i++));;
-*) ;;
*)
@@ -55,7 +55,7 @@ __ruby() {
if type -t _filedir >/dev/null; then
_filedir -d
fi
- elif [[ $switches_accepted && $cur == -* ]]; then
+ elif [[ $switches_accepted && $cur = -* ]]; then
COMPREPLY=($(compgen -W "$options" -- "$cur"))
elif [[ ! $script_given ]]; then
if [[ $script_in_path ]]; then
Please sign in to comment.
Something went wrong with that request. Please try again.