[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-171-gc875723
Ville Skyttä
ville.skytta at iki.fi
Mon May 2 09:55:26 UTC 2011
The following commit has been merged in the master branch:
commit c875723bef3b47a1fb0f364e6e0b2c282f46dce3
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Mon May 2 11:41:52 2011 +0300
Include trailing equals sign in options that take arguments that way.
This way it's clearer to users that an argument is expected. It's
likely that this commit does not catch all such cases, but it should
do it for most of the affected commands I have installed.
diff --git a/bash_completion b/bash_completion
index 591e1da..70591f1 100644
--- a/bash_completion
+++ b/bash_completion
@@ -774,11 +774,13 @@ _parse_help()
# Expand --[no]foo to --foo and --nofoo
if [[ $option == *\[no\]?* ]]; then
option2=${option/\[no\]/}
- printf '%s\n' "${option2%%[=<{[]*}"
+ option2=${option2%%[<{[]*}
+ printf '%s\n' "${option2/=*/=}"
option=${option/\[no\]/no}
fi
- printf '%s\n' "${option%%[=<{[]*}"
+ option=${option%%[<{[]*}
+ printf '%s\n' "${option/=*/=}"
done
}
@@ -1678,8 +1680,9 @@ _longopt()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
- sed -ne 's/.*\(--[-A-Za-z0-9]\{1,\}\).*/\1/p' | sort -u )" \
+ sed -ne 's/.*\(--[-A-Za-z0-9]\{1,\}=\?\).*/\1/p' | sort -u )" \
-- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
elif [[ "$1" == @(mk|rm)dir ]]; then
compopt +o default
_filedir -d
diff --git a/completions/_mock b/completions/_mock
index d4a26de..55d7a0f 100644
--- a/completions/_mock
+++ b/completions/_mock
@@ -61,6 +61,7 @@ _mock()
if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
_filedir '@(?(no)src.r|s)pm'
fi
diff --git a/completions/_yum b/completions/_yum
index 6caf21b..cf31da8 100644
--- a/completions/_yum
+++ b/completions/_yum
@@ -137,6 +137,7 @@ _yum()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
} &&
diff --git a/completions/aspell b/completions/aspell
index a0c861c..ae5b336 100644
--- a/completions/aspell
+++ b/completions/aspell
@@ -60,27 +60,28 @@ _aspell()
$split && return 0
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--conf --conf-dir --data-dir --dict-dir \
- --encoding --add-filter --rem-filter --mode \
- --add-extra-dicts --rem-extra-dicts \
- --home-dir --ignore --ignore-accents \
+ COMPREPLY=( $( compgen -W '--conf= --conf-dir= --data-dir= --dict-dir= \
+ --encoding= --add-filter= --rem-filter= --mode= \
+ --add-extra-dicts= --rem-extra-dicts= \
+ --home-dir= --ignore= --ignore-accents \
--dont-ignore-accents --ignore-case --dont-ignore-case \
- --ignore-repl --dont-ignore-repl --jargon --keyboard \
- --lang --language-tag --local-data-dir --master \
+ --ignore-repl --dont-ignore-repl --jargon --keyboard= \
+ --lang= --language-tag --local-data-dir= --master= \
--module --add-module-search-order \
- --rem-module-search-order --per-conf --personal \
- --prefix --repl --run-together --dont-run-together \
- --run-together-limit --run-together-min --save-repl \
- --dont-save-repl --set-prefix --dont-set-prefix --size \
+ --rem-module-search-order --per-conf= --personal= \
+ --prefix= --repl= --run-together --dont-run-together \
+ --run-together-limit= --run-together-min= --save-repl \
+ --dont-save-repl --set-prefix --dont-set-prefix --size= \
--spelling --strip-accents --dont-strip-accents \
- --sug-mode --add-word-list-path --rem-word-list-path \
+ --sug-mode= --add-word-list-path --rem-word-list-path \
--backup --dont-backup --reverse --dont-reverse \
- --time --dont-time --keymapping --add-email-quote \
- --rem-email-quote --email-margin --add-tex-command \
- --rem-tex-command --tex-check-comments \
+ --time --dont-time --keymapping= --add-email-quote= \
+ --rem-email-quote= --email-margin= --add-tex-command= \
+ --rem-tex-command= --tex-check-comments \
--dont-tex-check-comments --add-tex-extension \
- --rem-tex-extension --add-sgml-check --rem-sgml-check \
+ --rem-tex-extension --add-sgml-check= --rem-sgml-check= \
--add-sgml-extension --rem-sgml-extension' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
COMPREPLY=( $( compgen -W 'usage help check pipe list \
config soundslike filter version dump create merge' -- "$cur" ) )
diff --git a/completions/autoconf b/completions/autoconf
index 716755b..ba6dd18 100644
--- a/completions/autoconf
+++ b/completions/autoconf
@@ -30,6 +30,7 @@ _autoconf()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
@@ -64,6 +65,7 @@ _autoreconf()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
@@ -95,6 +97,7 @@ _autoscan()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
diff --git a/completions/automake b/completions/automake
index cb70530..2080f25 100644
--- a/completions/automake
+++ b/completions/automake
@@ -26,6 +26,7 @@ _automake()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
@@ -62,6 +63,7 @@ _aclocal()
$split && return 0
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _aclocal aclocal aclocal-1.11
diff --git a/completions/configure b/completions/configure
index 285edb3..af1c736 100644
--- a/completions/configure
+++ b/completions/configure
@@ -33,8 +33,10 @@ _configure()
awk '/^ --[A-Za-z]/ { print $1; \
if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' )" \
-- "$cur" ) )
+ [[ $COMPREPLY == *=* ]] && compopt -o nospace
else
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
fi
} &&
complete -F _configure configure
diff --git a/completions/coreutils b/completions/coreutils
index d1928ec..d4a5558 100644
--- a/completions/coreutils
+++ b/completions/coreutils
@@ -129,6 +129,7 @@ _mktemp()
local opts=$( _parse_help "$1" )
[[ $opts ]] || opts="-d -u -q -p -t" # non-GNU fallback
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
fi
} &&
complete -F _mktemp mktemp
diff --git a/completions/cryptsetup b/completions/cryptsetup
index 1fe1d70..9b29a54 100644
--- a/completions/cryptsetup
+++ b/completions/cryptsetup
@@ -33,6 +33,7 @@ _cryptsetup()
if [ -z $arg ]; then
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
COMPREPLY=( $( compgen -W 'create remove status resize luksFormat \
luksOpen luksClose luksSuspend luksResume luksAddKey \
diff --git a/completions/cvs b/completions/cvs
index 0a397a4..9570f85 100644
--- a/completions/cvs
+++ b/completions/cvs
@@ -283,6 +283,7 @@ _cvs()
diff)
if [[ "$cur" == -* ]]; then
_cvs_command_options "$1" $mode
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
get_entries
COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) )
diff --git a/completions/dpkg b/completions/dpkg
index ee78f99..d6ae6bc 100644
--- a/completions/dpkg
+++ b/completions/dpkg
@@ -58,12 +58,12 @@ _dpkg()
COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
return 0
;;
- *)
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- ;;
esac
+ $split && return
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _dpkg dpkg dpkg-deb
}
diff --git a/completions/getent b/completions/getent
index 5ba3fcd..012c229 100644
--- a/completions/getent
+++ b/completions/getent
@@ -68,6 +68,7 @@ _getent()
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
elif [[ -z $db ]]; then
COMPREPLY=( $( compgen -W 'passwd group hosts services protocols \
networks ahosts ahostsv4 ahostsv6 aliases ethers netgroup rpc \
diff --git a/completions/gzip b/completions/gzip
index 3913c83..3b33de1 100644
--- a/completions/gzip
+++ b/completions/gzip
@@ -16,6 +16,7 @@ _gzip()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \
-- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
diff --git a/completions/iconv b/completions/iconv
index ed06067..16e3903 100644
--- a/completions/iconv
+++ b/completions/iconv
@@ -27,6 +27,7 @@ _iconv()
if [[ "$cur" = -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
} &&
diff --git a/completions/info b/completions/info
index cdc851f..ee2b7a5 100644
--- a/completions/info
+++ b/completions/info
@@ -33,6 +33,7 @@ _info()
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
diff --git a/completions/java b/completions/java
index bf3bee4..f848cae 100644
--- a/completions/java
+++ b/completions/java
@@ -493,7 +493,7 @@ have javaws &&
_javaws()
{
local cur prev words cword
- _init_completion || return
+ _init_completion -n = || return
case $prev in
-help|-license|-about|-viewer|-arg|-param|-property|-update|-umask)
@@ -509,8 +509,11 @@ _javaws()
;;
esac
- if [[ $cur == -* ]]; then
+ if [[ $cur == *= ]]; then
+ return 0
+ elif [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W "$( _parse_help "$1" -help ) " -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
diff --git a/completions/k3b b/completions/k3b
index 56b6c11..9f41ed5 100644
--- a/completions/k3b
+++ b/completions/k3b
@@ -40,6 +40,7 @@ _k3b()
if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
_filedir
fi
diff --git a/completions/man b/completions/man
index 1b3ae4e..0fa17a0 100644
--- a/completions/man
+++ b/completions/man
@@ -42,6 +42,7 @@ _man()
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
diff --git a/completions/mc b/completions/mc
index cec0c4d..27ddc0a 100644
--- a/completions/mc
+++ b/completions/mc
@@ -27,6 +27,7 @@ _mc()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \
-- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
_filedir -d
fi
diff --git a/completions/mdadm b/completions/mdadm
index c91671c..19647e0 100644
--- a/completions/mdadm
+++ b/completions/mdadm
@@ -102,7 +102,7 @@ _mdadm()
local options
options='--help --help-options --version --verbose --quiet \
- --brief --force --config --scan --metadata --homehost'
+ --brief --force --config= --scan --metadata= --homehost='
if [[ "$cur" == -* ]]; then
if [[ $cword -eq 1 ]] ; then
@@ -111,18 +111,18 @@ _mdadm()
else
case ${words[cword-1]} in
-A|--assemble)
- COMPREPLY=( $( compgen -W "$options --uuid \
- --super-minor --name --force --run \
- --no-degraded --auto --bitmap --backup-file \
- --update --auto-update-homehost" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "$options --uuid= \
+ --super-minor= --name= --force --run \
+ --no-degraded --auto= --bitmap= --backup-file= \
+ --update= --auto-update-homehost" -- "$cur" ) )
;;
-B|-C|-G|--build|--create|--grow)
- COMPREPLY=( $( compgen -W "$options --raid-devices \
- --spare-devices --size --chunk --rounding \
- --level --layout --parity --bitmap \
- --bitmap-chunk --write-mostly --write-behind \
- --assume-clean --backup-file --name --run \
- --force --auto" -- "$cur" ) )
+ COMPREPLY=( $( compgen -W "$options --raid-devices= \
+ --spare-devices= --size= --chunk= --rounding= \
+ --level= --layout= --parity= --bitmap= \
+ --bitmap-chunk= --write-mostly --write-behind= \
+ --assume-clean --backup-file= --name= --run \
+ --force --auto=" -- "$cur" ) )
;;
-F|--follow|--monitor)
COMPREPLY=( $( compgen -W "$options --mail --program \
@@ -142,6 +142,7 @@ _mdadm()
;;
esac
fi
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
cur=${cur:=/dev/}
_filedir
diff --git a/completions/mkinitrd b/completions/mkinitrd
index d087b75..9efdf8e 100644
--- a/completions/mkinitrd
+++ b/completions/mkinitrd
@@ -28,9 +28,10 @@ _mkinitrd()
COMPREPLY=( $( compgen -W '--version --help -v -f --preload \
--force-scsi-probe --omit-scsi-modules \
--omit-ide-modules --image-version --force-raid-probe \
- --omit-raid-modules --with --force-lvm-probe \
+ --omit-raid-modules --with= --force-lvm-probe \
--omit-lvm-modules --builtin --omit-dmraid --net-dev \
--fstab --nocompress --dsdt --bootchart' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
local args
_count_args
diff --git a/completions/mysqladmin b/completions/mysqladmin
index 52a5897..b14a90b 100644
--- a/completions/mysqladmin
+++ b/completions/mysqladmin
@@ -49,6 +49,8 @@ _mysqladmin()
flush-logs flush-status flush-tables flush-threads flush-privileges \
kill password old-password ping processlist reload refresh shutdown \
status start-slave stop-slave variables version' -- "$cur" ) )
+
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _mysqladmin mysqladmin
diff --git a/completions/net-tools b/completions/net-tools
index 53e9006..646b282 100644
--- a/completions/net-tools
+++ b/completions/net-tools
@@ -23,6 +23,7 @@ _mii_tool()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
_available_interfaces -a
fi
diff --git a/completions/pkg-config b/completions/pkg-config
index 181e082..b30fa55 100644
--- a/completions/pkg-config
+++ b/completions/pkg-config
@@ -23,6 +23,7 @@ _pkg_config()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
COMPREPLY=( $( compgen -W "$( pkg-config --list-all \
2>/dev/null | awk '{print $1}' )" -- "$cur" ) )
diff --git a/completions/postgresql b/completions/postgresql
index 15bef85..e3c3d12 100644
--- a/completions/postgresql
+++ b/completions/postgresql
@@ -48,6 +48,7 @@ _createdb()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
_pg_databases
fi
@@ -80,6 +81,7 @@ _dropdb()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
_pg_databases
fi
@@ -126,6 +128,7 @@ _psql()
if [[ "$cur" == -* ]]; then
# return list of available options
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
# return list of available databases
_pg_databases
diff --git a/completions/rpm b/completions/rpm
index a95f3bc..3984524 100644
--- a/completions/rpm
+++ b/completions/rpm
@@ -116,8 +116,8 @@ _rpm()
$split && return 0
# options common to all modes
- local opts="--define --eval --macros --nodigest --nosignature --rcfile \
- --quiet --pipe --verbose"
+ local opts="--define= --eval= --macros= --nodigest --nosignature \
+ --rcfile= --quiet --pipe --verbose"
case ${words[1]} in
-[iFU]*|--install|--freshen|--upgrade)
@@ -125,10 +125,10 @@ _rpm()
COMPREPLY=( $( compgen -W "$opts --percent --force \
--test --replacepkgs --replacefiles --root \
--excludedocs --includedocs --noscripts --ignorearch \
- --dbpath --prefix --ignoreos --nodeps --allfiles \
+ --dbpath --prefix= --ignoreos --nodeps --allfiles \
--ftpproxy --ftpport --justdb --httpproxy --httpport \
- --noorder --relocate --badreloc --notriggers \
- --excludepath --ignoresize --oldpackage \
+ --noorder --relocate= --badreloc --notriggers \
+ --excludepath= --ignoresize --oldpackage \
--queryformat --repackage --nosuggests" -- "$cur" ) )
else
_filedir '[rs]pm'
@@ -148,7 +148,7 @@ _rpm()
opts+=" --changelog --configfiles --conflicts --docfiles
--dump --enhances --filesbypkg --filecaps --fileclass
--filecolor --fileprovide --filerequire --filesbypkg --info
- --list --obsoletes --pipe --provides --queryformat --rcfile
+ --list --obsoletes --pipe --provides --queryformat=
--requires --scripts --suggests --triggers --xml"
if [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then
@@ -175,7 +175,7 @@ _rpm()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$opts --all --file --fileid
--dbpath --fscontext --ftswalk --group --hdrid --last
- --package --pkgid --root --specfile --state
+ --package --pkgid --root= --specfile --state
--triggeredby --whatprovides --whatrequires" \
-- "$cur" ) )
elif [[ ${words[@]} != *\ -@(*([^ -])a|-all )* ]]; then
@@ -193,7 +193,7 @@ _rpm()
;;
-[Vy]*|--verify)
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W "$opts --root --dbpath --nodeps \
+ COMPREPLY=( $( compgen -W "$opts --root= --dbpath --nodeps \
--nogroup --nolinkto --nomode --nomtime --nordev --nouser \
--nofiles --noscripts --nomd5 --querytags --specfile \
--whatrequires --whatprovides" -- "$cur" ) )
@@ -216,13 +216,14 @@ _rpm()
;;
--import|--dbpath|--root)
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--import --dbpath --root' \
+ COMPREPLY=( $( compgen -W '--import --dbpath --root=' \
-- "$cur" ) )
else
_filedir
fi
;;
esac
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
} &&
@@ -271,6 +272,7 @@ _rpmbuild()
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
diff --git a/completions/shadow b/completions/shadow
index c65a980..de78c59 100644
--- a/completions/shadow
+++ b/completions/shadow
@@ -167,6 +167,7 @@ _chpasswd()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
} &&
@@ -193,6 +194,7 @@ _newusers()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
@@ -234,6 +236,7 @@ _groupadd()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
} &&
@@ -258,6 +261,7 @@ _groupmod()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
@@ -382,6 +386,7 @@ _faillog()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
} &&
@@ -407,6 +412,7 @@ _lastlog()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
} &&
diff --git a/completions/smartctl b/completions/smartctl
index 14ebe43..e950f87 100644
--- a/completions/smartctl
+++ b/completions/smartctl
@@ -154,10 +154,12 @@ _smartctl()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help --version --info --all --xall
- --scan --scan-open --quietmode --device --tolerance --badsum
- --report --nocheck --smart --offlineauto --saveauto --health
- --capabilities --attributes --log --vendorattribute --firmwarebug
- --presets --drivedb --test --captive --abort' -- "$cur" ) )
+ --scan --scan-open --quietmode= --device= --tolerance= --badsum=
+ --report= --nocheck= --smart= --offlineauto= --saveauto= --health
+ --capabilities --attributes --log= --vendorattribute=
+ --firmwarebug= --presets= --drivedb= --test= --captive --abort' \
+ -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
else
cur=${cur:=/dev/}
_filedir
diff --git a/completions/sysbench b/completions/sysbench
index 8db9b3c..82a0136 100644
--- a/completions/sysbench
+++ b/completions/sysbench
@@ -116,15 +116,12 @@ _sysbench()
fi
done
- # Long options need the "=" (whitespace split doesn't work), so we
- # include it in completions that require a value.
-
local opts="--num-threads= --max-requests= --max-time= --thread-stack-size=
--init-rng= --debug= --validate= --help --version"
if [[ $test ]]; then
local help=( $( _parse_help "$1" "--test=$test help" ) )
- opts+=" ${help[@]/%/=} prepare run cleanup help version"
+ opts+=" ${help[@]} prepare run cleanup help version"
else
opts+=" --test="
fi
diff --git a/completions/wol b/completions/wol
index 23b603f..001e2f6 100644
--- a/completions/wol
+++ b/completions/wol
@@ -29,6 +29,7 @@ _wol()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
diff --git a/completions/wvdial b/completions/wvdial
index 555a638..4a2620c 100644
--- a/completions/wvdial
+++ b/completions/wvdial
@@ -21,6 +21,7 @@ _wvdial()
case $cur in
-*)
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
;;
*)
# start with global and personal config files
diff --git a/completions/xz b/completions/xz
index a438eca..80a70dd 100644
--- a/completions/xz
+++ b/completions/xz
@@ -9,6 +9,7 @@ _xz()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" --long-help ) {-1..-9}' \
-- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
@@ -62,6 +63,7 @@ _xzdec()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
diff --git a/test/unit/_parse_help.exp b/test/unit/_parse_help.exp
index 460c958..c746b65 100644
--- a/test/unit/_parse_help.exp
+++ b/test/unit/_parse_help.exp
@@ -50,15 +50,15 @@ assert_bash_list "-one" $cmd "internal dash 2"
sync_after_int
set cmd {fn() { printf '%s\n' "--long-arg=value"; }; _parse_help fn}
-assert_bash_list "--long-arg" $cmd "value stripped"
+assert_bash_list "--long-arg=" $cmd "value stripped"
sync_after_int
set cmd {fn() { printf '%s\n' "--long-arg=-value"; }; _parse_help fn}
-assert_bash_list "--long-arg" $cmd "value not seen as option"
+assert_bash_list "--long-arg=" $cmd "value not seen as option"
sync_after_int
set cmd {fn() { printf '%s\n' "--long-arg=-value,--opt2=val"; }; _parse_help fn}
-assert_bash_list "--long-arg" $cmd "two options with values"
+assert_bash_list "--long-arg=" $cmd "two options with values"
sync_after_int
set cmd {fn() { printf '%s\n' "-m,--mirror"; }; _parse_help fn}
@@ -82,11 +82,11 @@ assert_bash_list "--foo" $cmd "long with value and eq sign in brackets"
sync_after_int
set cmd {fn() { printf '%s\n' "--foo=<bar>"; }; _parse_help fn}
-assert_bash_list "--foo" $cmd "long with value in angle brackets"
+assert_bash_list "--foo=" $cmd "long with value in angle brackets"
sync_after_int
set cmd {fn() { printf '%s\n' "--foo={bar,quux}"; }; _parse_help fn}
-assert_bash_list "--foo" $cmd "long with value in curly brackets"
+assert_bash_list "--foo=" $cmd "long with value in curly brackets"
sync_after_int
set cmd {fn() { printf '%s\n' "--[no]foo"; }; _parse_help fn}
--
bash-completion
More information about the Bash-completion-commits
mailing list