mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
CONFIG: prevent bash completions from examining the description notes
This commit is contained in:
committed by
Andrew Heather
parent
6dd3cd0e51
commit
f30b0895e8
@ -155,11 +155,15 @@ HEADER
|
|||||||
# - options with '=' (eg, -mode=ugo) are not handled very well at all.
|
# - options with '=' (eg, -mode=ugo) are not handled very well at all.
|
||||||
# - alternatives (eg, -a, -all) are not handled nicely either,
|
# - alternatives (eg, -a, -all) are not handled nicely either,
|
||||||
# for these treat ',' like a space to catch the worst of them.
|
# 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()
|
extractOptions()
|
||||||
{
|
{
|
||||||
local appName="$1"
|
local appName="$1"
|
||||||
local helpText=$($appName -help-full 2>/dev/null | \
|
local helpText=$($appName -help-full 2>/dev/null | \
|
||||||
sed -ne '1,/^[Oo]ptions:/d' \
|
sed -ne '1,/^[Oo]ptions:/d' \
|
||||||
|
-e '/^ \{8\}/d;' \
|
||||||
-e 's/^ *//; /^$/d; /^[^-]/d; /^--/d; /^-help-man/d;' \
|
-e 's/^ *//; /^$/d; /^[^-]/d; /^--/d; /^-help-man/d;' \
|
||||||
-e '/^-hostRoots /d; /^-roots /d;' \
|
-e '/^-hostRoots /d; /^-roots /d;' \
|
||||||
-e '/^-lib /d;' \
|
-e '/^-lib /d;' \
|
||||||
|
|||||||
@ -146,10 +146,14 @@ _of_complete_()
|
|||||||
# - options with '=' (eg, -mode=ugo) are not handled very well at all.
|
# - options with '=' (eg, -mode=ugo) are not handled very well at all.
|
||||||
# - alternatives (eg, -a, -all) are not handled nicely either,
|
# - alternatives (eg, -a, -all) are not handled nicely either,
|
||||||
# for these treat ',' like a space to catch the worst of them.
|
# 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" ]
|
if [ -z "$choices" ]
|
||||||
then
|
then
|
||||||
local helpText=$($appName -help-full 2>/dev/null | \
|
local helpText=$($appName -help-full 2>/dev/null | \
|
||||||
sed -ne '1,/^[Oo]ptions:/d' \
|
sed -ne '1,/^[Oo]ptions:/d' \
|
||||||
|
-e '/^ \{8\}/d;' \
|
||||||
-e 's/^ *//; /^$/d; /^[^-]/d; /^--/d; /^-help-man/d;' \
|
-e 's/^ *//; /^$/d; /^[^-]/d; /^--/d; /^-help-man/d;' \
|
||||||
-e 'y/,/ /; s/=.*$/=/;' \
|
-e 'y/,/ /; s/=.*$/=/;' \
|
||||||
-e '/^-[^ ]* </{ s/^\(-[^ ]* <\).*$/\1/; p; d }' \
|
-e '/^-[^ ]* </{ s/^\(-[^ ]* <\).*$/\1/; p; d }' \
|
||||||
|
|||||||
Reference in New Issue
Block a user