diff --git a/bin/tools/foamCreateCompletionCache b/bin/tools/foamCreateCompletionCache index d4d060504d..c42ac097e6 100755 --- a/bin/tools/foamCreateCompletionCache +++ b/bin/tools/foamCreateCompletionCache @@ -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;' \ diff --git a/etc/config.sh/bash_completion b/etc/config.sh/bash_completion index 23805b4ae2..001c6d0002 100644 --- a/etc/config.sh/bash_completion +++ b/etc/config.sh/bash_completion @@ -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 '/^-[^ ]*