From 2469f698e97f4c8963370047ff22b64d0377e272 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 5 Dec 2018 08:50:38 +0100 Subject: [PATCH] CONFIG: update completion_cache (for csh users) - now consider options '-hostRoots', '-roots' to be advanced options that don't need to be in the cache --- bin/tools/foamCreateCompletionCache | 27 +- etc/config.sh/completion_cache | 396 ++++++++++++++-------------- 2 files changed, 216 insertions(+), 207 deletions(-) diff --git a/bin/tools/foamCreateCompletionCache b/bin/tools/foamCreateCompletionCache index cf1bcdef50..0e1e81bf1e 100755 --- a/bin/tools/foamCreateCompletionCache +++ b/bin/tools/foamCreateCompletionCache @@ -27,11 +27,12 @@ usage() { Usage: ${0##*/} [OPTION] [appName .. [appNameN]] options: - -d dir | -dir dir Directory to process - -u | -user Add \$FOAM_USER_APPBIN to the search directories - -no-header Suppress header generation - -o FILE Write to alternative output - -h | -help Print the usage + -dir DIR Directory to process + -user Add \$FOAM_USER_APPBIN to the search directories + -no-header Suppress header generation + -output FILE, -o FILE + Write to alternative output + -h | -help Print the usage Create cache of bash completion values for OpenFOAM applications. The cached values are typically used by the tcsh completion wrapper. @@ -68,13 +69,13 @@ do -h | -help*) usage ;; - -d | -dir) + -dir) [ "$#" -ge 2 ] || die "'$1' option requires an argument" searchDirs="$2" [ -d "$searchDirs" ] || die "directory not found '$searchDirs'" shift ;; - -u | -user) + -user) searchDirs="$searchDirs $FOAM_USER_APPBIN" ;; -no-head*) @@ -116,8 +117,8 @@ echo 1>&2 # Header not disabled [ "$optHeader" = true ] && cat << HEADER #----------------------------------*-sh-*-------------------------------------- -# Cached options for bash completion of OpenFOAM applications, primarily for -# use with the tcsh completion mechanism. +# Cached options for bash completion of OpenFOAM applications, +# primarily for use with the tcsh completion mechanism. # These are the values expected by the '_of_complete_' function # # Recreate with "${0##*/}" @@ -140,7 +141,12 @@ HEADER # -opt1 descrip # -opt2 descrip # -help-full -# Ignore -help-man (internal option). +# +# Ignores +# -help-man Internal option +# -hostRoots Advanced distributed run option +# -roots Advanced distributed run option +# # Terminate parsing on first appearance of -help-full. # - options with '=' (eg, -mode=ugo) are not handled very well at all. # - alternatives (eg, -a, -all) are not handled nicely either, @@ -150,6 +156,7 @@ extractOptions() local appName="$1" local helpText=$($appName -help-full 2>/dev/null | \ sed -ne 's/^ *//; /^$/d; /^[^-]/d; /^--/d; /^-help-man/d;' \ + -e '/^-hostRoots /d; /^-roots /d;' \ -e 'y/,/ /; s/=.*$/=/;' \ -e '/^-[^ ]*