CONFIG: prevent bash completions from examining the description notes
This commit is contained in:
parent
6dd3cd0e51
commit
f30b0895e8
@ -155,11 +155,15 @@ HEADER
|
||||
# - options with '=' (eg, -mode=ugo) are not handled very well at all.
|
||||
# - alternatives (eg, -a, -all) are not handled nicely either,
|
||||
# for these treat ',' like a space to catch the worst of them.
|
||||
#
|
||||
# Remove anything that starts with more than 8 spaces to avoid parsing
|
||||
# any of the option description text
|
||||
extractOptions()
|
||||
{
|
||||
local appName="$1"
|
||||
local helpText=$($appName -help-full 2>/dev/null | \
|
||||
sed -ne '1,/^[Oo]ptions:/d' \
|
||||
-e '/^ \{8\}/d;' \
|
||||
-e 's/^ *//; /^$/d; /^[^-]/d; /^--/d; /^-help-man/d;' \
|
||||
-e '/^-hostRoots /d; /^-roots /d;' \
|
||||
-e '/^-lib /d;' \
|
||||
|
@ -146,10 +146,14 @@ _of_complete_()
|
||||
# - options with '=' (eg, -mode=ugo) are not handled very well at all.
|
||||
# - alternatives (eg, -a, -all) are not handled nicely either,
|
||||
# for these treat ',' like a space to catch the worst of them.
|
||||
#
|
||||
# Remove anything that starts with more than 8 spaces to avoid parsing
|
||||
# any of the option description text
|
||||
if [ -z "$choices" ]
|
||||
then
|
||||
local helpText=$($appName -help-full 2>/dev/null | \
|
||||
sed -ne '1,/^[Oo]ptions:/d' \
|
||||
-e '/^ \{8\}/d;' \
|
||||
-e 's/^ *//; /^$/d; /^[^-]/d; /^--/d; /^-help-man/d;' \
|
||||
-e 'y/,/ /; s/=.*$/=/;' \
|
||||
-e '/^-[^ ]* </{ s/^\(-[^ ]* <\).*$/\1/; p; d }' \
|
||||
|
Loading…
Reference in New Issue
Block a user