Make _parse_help() work with slash separated options.
This commit is contained in:
parent
52bfcefb3d
commit
96c6416309
4
CHANGES
4
CHANGES
@ -14,7 +14,8 @@ bash-completion (2.x)
|
||||
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
|
||||
filename completions.
|
||||
* Add "short" tarball extensions to unxz, unlzma etc completions.
|
||||
* Improve /etc/init.d/*, ipmitool, jar, povray, and sqlite3 completions.
|
||||
* Improve /etc/init.d/*, ipmitool, jar, mencoder, mplayer, povray, sqlite3,
|
||||
and general help parsing completions.
|
||||
* Fix p4 and povray completions (Alioth: #312625).
|
||||
* Add *.xsd, *.xsl, *.rng, and *.wsdl to xmllint filename completions.
|
||||
* Recognize rpm query mode based on the --file, --group, --package, and
|
||||
@ -24,7 +25,6 @@ bash-completion (2.x)
|
||||
* Make _filedir and _filedir_xspec complete uppercase versions of their
|
||||
filename extension arguments in addition to exact case matches.
|
||||
* IPv6 known hosts completion fixes (Alioth: #312695, RedHat: #630658).
|
||||
* Improve mplayer and mencoder completions.
|
||||
* Fixes to completions for filenames containing tabs (RedHat: #629518).
|
||||
|
||||
[ Freddy Vulto ]
|
||||
|
@ -676,7 +676,7 @@ _split_longopt()
|
||||
# @param $2 command options (default: --help)
|
||||
#
|
||||
_parse_help() {
|
||||
$1 ${2:---help} 2>&1 | sed -e '/^[[:space:]]*-/!d' -e 's/,/ /g' | \
|
||||
$1 ${2:---help} 2>&1 | sed -e '/^[[:space:]]*-/!d' -e 's|[,/]| |g' | \
|
||||
awk '{ print $1; if ($2 ~ /^-/) { print $2 } }' | sed -e 's|=.*||'
|
||||
}
|
||||
|
||||
|
@ -61,5 +61,13 @@ set cmd {fn() { printf '%s\n' "--long-arg=-value,--opt2=val"; }; _parse_help fn}
|
||||
assert_bash_list "--long-arg\n--opt2" $cmd "two options with values"
|
||||
sync_after_int
|
||||
|
||||
set cmd {fn() { printf '%s\n' "-m,--mirror"; }; _parse_help fn}
|
||||
assert_bash_list "-m\n--mirror" $cmd "short + long"
|
||||
sync_after_int
|
||||
|
||||
set cmd {fn() { printf '%s\n' "-T/--upload-file"; }; _parse_help fn}
|
||||
assert_bash_list "-T\n--upload-file" $cmd "short + long, slash separated"
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
||||
|
Loading…
x
Reference in New Issue
Block a user