mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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
This commit is contained in:
@ -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 <arg> 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 '/^-[^ ]* </{ s/^\(-[^ ]* <\).*$/\1/; p; d }' \
|
||||
-e 's/^\(-[^ ]*\).*$/\1/; p; /^-help-full/q;' \
|
||||
|
||||
Reference in New Issue
Block a user