ENH: use bash associative array for on-the-fly completion (issue #551)
- this reduces the number of functions and allows lazy loading of completion options, which makes it easy to quickly add any other OpenFOAM application in completion. The generic '_of_complete_' function handles (bash) completion for any OpenFOAM application. On the first call for any particular application, it retrieves the available options from the application help output and adds this information to its environmental cache for subsequent use. - Tcsh completion uses the same function via a bash wrapper. But since its wrapper is transient, the on-the-fly generation would be less efficient. For this case, a pre-generated completion_cache can be used, which is generated with bin/tools/foamCreateCompletionCache
This commit is contained in:
parent
e0ebc8e973
commit
ce0868106a
@ -1,274 +0,0 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# foamCreateBashCompletions
|
||||
#
|
||||
# Description
|
||||
# Create bash completions for OpenFOAM applications
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} [OPTION] [appName .. [appNameN]]
|
||||
options:
|
||||
-d dir | -dir dir Directory to process
|
||||
-u | -user Add \$FOAM_USER_APPBIN to the search directories
|
||||
-head | -header Generate header
|
||||
-h | -help Print the usage
|
||||
|
||||
Create bash completions for OpenFOAM applications and write to stdout.
|
||||
By default searches \$FOAM_APPBIN only.
|
||||
Alternatively, scan the output from individual applications for single completion
|
||||
commands (using the '_of_complete_' backend).
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
searchDirs="$FOAM_APPBIN"
|
||||
unset optHeader
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
-d | -dir)
|
||||
searchDirs="$2"
|
||||
[ -d $searchDirs ] || usage "directory not found '$searchDirs'"
|
||||
shift
|
||||
;;
|
||||
-u | -user)
|
||||
searchDirs="$searchDirs $FOAM_USER_APPBIN"
|
||||
;;
|
||||
-head | -header)
|
||||
optHeader=true
|
||||
;;
|
||||
-*)
|
||||
usage "unknown option: '$1'"
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# No applications given, then always generate a header
|
||||
if [ "$#" -eq 0 ]
|
||||
then
|
||||
optHeader=true
|
||||
fi
|
||||
|
||||
# Header requested or required
|
||||
[ "$optHeader" = true ] && cat << HEADER
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# Bash completions for OpenFOAM applications
|
||||
# Recreate with "${0##*/}"
|
||||
#
|
||||
# Formatted as "complete ... -F _of_APPNAME APPNAME
|
||||
|
||||
#
|
||||
# Generic completion handler for OpenFOAM applications
|
||||
# - arg1 = command-name
|
||||
# - arg2 = current word
|
||||
# - arg3 = previous word
|
||||
# - arg4 = options with args
|
||||
# - arg5 = boolean options
|
||||
#
|
||||
unset -f _of_complete_ 2>/dev/null
|
||||
_of_complete_()
|
||||
{
|
||||
# Unused: local cmd=\$1
|
||||
local cur=\$2
|
||||
local prev=\$3
|
||||
local optsWithArgs="\$4 " # Trailing space added for easier matching
|
||||
local opts="\$5 "
|
||||
local choices
|
||||
|
||||
case \${prev} in
|
||||
-help|-doc|-srcDoc)
|
||||
# These options are usage and we can stop here.
|
||||
COMPREPLY=()
|
||||
return 0
|
||||
;;
|
||||
-case)
|
||||
COMPREPLY=(\$(compgen -d -- \${cur}))
|
||||
;;
|
||||
-time)
|
||||
# Could use "foamListTimes -withZero", but still doesn't address ranges
|
||||
COMPREPLY=(\$(compgen -d -X '![-0-9]*' -- \${cur}))
|
||||
;;
|
||||
-region)
|
||||
choices=\$(\ls -d system/*/ 2>/dev/null | sed -e 's#/\$##' -e 's#^.*/##')
|
||||
COMPREPLY=(\$(compgen -W "\$choices" -- \${cur}))
|
||||
;;
|
||||
-fileHandler)
|
||||
choices="collated uncollated masterUncollated"
|
||||
COMPREPLY=(\$(compgen -W "\$choices" -- \${cur}))
|
||||
;;
|
||||
*Dict)
|
||||
# local dirs=\$(\ls -d s*/)
|
||||
# local files=\$(\ls -f | grep Dict)
|
||||
# COMPREPLY=(\$(compgen -W \"\$dirs \$files\" -- \${cur}))
|
||||
COMPREPLY=(\$(compgen -f -- \${cur}))
|
||||
;;
|
||||
*)
|
||||
if [ "\${optsWithArgs/\${prev} /}" != "\${optsWithArgs}" ]
|
||||
then
|
||||
# Option with unknown type of arg - set to files.
|
||||
# Not always correct but can still navigate path if needed...
|
||||
COMPREPLY=(\$(compgen -f -- \${cur}))
|
||||
elif [ -n "\$cur" -a "\${cur#-}" = "\${cur}" ]
|
||||
then
|
||||
# Already started a (non-empty) word that isn't an option,
|
||||
# use files in which case revert to filenames.
|
||||
COMPREPLY=(\$(compgen -f -- \${cur}))
|
||||
else
|
||||
# Catchall
|
||||
# - Present remaining options (not already seen in \$COMP_LINE)
|
||||
choices=\$(
|
||||
for o in \${opts} \${optsWithArgs}
|
||||
do
|
||||
[ "\${COMP_LINE/\$o/}" = "\${COMP_LINE}" ] && echo \$o
|
||||
done
|
||||
)
|
||||
COMPREPLY=(\$(compgen -W "\$choices" -- \${cur}))
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
HEADER
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Scans the output of the application -help to detect options with/without
|
||||
# arguments. Dispatch via _of_complete_
|
||||
#
|
||||
generateCompletion()
|
||||
{
|
||||
local fullName="$1"
|
||||
local appName="${1##*/}"
|
||||
local appHelp
|
||||
|
||||
[ -f "$fullName" -a -x "$fullName" ] || {
|
||||
echo "skip $fullName" 1>&2
|
||||
return 1
|
||||
}
|
||||
if [ "$appName" = "complete_" ]
|
||||
then
|
||||
echo "skip $appName ... reserved name?" 1>&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
appHelp=$($fullName -help) || {
|
||||
echo "error calling $fullName" 1>&2
|
||||
return 1
|
||||
}
|
||||
|
||||
# Options with args - as array
|
||||
local optsWithArgs=($(awk '/^ {0,4}-[a-z]/ && /</ {print $1}' <<< "$appHelp"))
|
||||
|
||||
# Options without args - as array
|
||||
local opts=($(awk '/^ {0,4}-[a-z]/ && !/</ {print $1}' <<< "$appHelp"))
|
||||
|
||||
# See bash(1) for some details. Completion functions are called with
|
||||
# arg1 = command-name, arg2 = current word, arg3 = previous word
|
||||
#
|
||||
# Append known option types and dispatch to _of_complete_
|
||||
echo " $appName" 1>&2
|
||||
cat << COMPLETION
|
||||
|
||||
# [$appName]
|
||||
unset -f _of_${appName} 2>/dev/null
|
||||
_of_${appName}() {
|
||||
_of_complete_ "\$@" \\
|
||||
"${optsWithArgs[@]}" \\
|
||||
"${opts[@]}"
|
||||
}
|
||||
complete -o filenames -F _of_${appName} $appName
|
||||
|
||||
COMPLETION
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
if [ "$#" -eq 0 ]
|
||||
then
|
||||
|
||||
for dir in ${searchDirs}
|
||||
do
|
||||
if [ -d "$dir" ]
|
||||
then
|
||||
echo "Processing directory $dir" 1>&2
|
||||
else
|
||||
echo "No such directory: $dir" 1>&2
|
||||
continue
|
||||
fi
|
||||
|
||||
# Sort with ignore-case
|
||||
set -- $(\ls $dir | sort -f)
|
||||
for appName
|
||||
do
|
||||
generateCompletion "$dir/$appName"
|
||||
done
|
||||
done
|
||||
|
||||
else
|
||||
|
||||
for appName
|
||||
do
|
||||
if [ -f "$appName" -a -x "$appName" ]
|
||||
then
|
||||
generateCompletion "$appName"
|
||||
elif fullName=$(command -v $appName 2>/dev/null)
|
||||
then
|
||||
generateCompletion "$fullName"
|
||||
else
|
||||
echo "No application found: $appName" 1>&2
|
||||
fi
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# Generate footer
|
||||
[ "$optHeader" = true ] && cat << FOOTER
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
FOOTER
|
||||
|
||||
#------------------------------------------------------------------------------
|
199
bin/tools/foamCreateCompletionCache
Executable file
199
bin/tools/foamCreateCompletionCache
Executable file
@ -0,0 +1,199 @@
|
||||
#!/bin/bash
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# foamCreateCompletionCache
|
||||
#
|
||||
# Description
|
||||
# Create cache of bash completion values for OpenFOAM applications
|
||||
# The cached values are typically used by the tcsh completion wrapper.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
defaultOutputFile="$WM_PROJECT_DIR/etc/config.sh/completion_cache"
|
||||
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<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
|
||||
|
||||
Create cache of bash completion values for OpenFOAM applications.
|
||||
The cached values are typically used by the tcsh completion wrapper.
|
||||
Default search: \$FOAM_APPBIN only.
|
||||
Default output: $defaultOutputFile
|
||||
|
||||
Uses the search directory if applications are specified.
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Report error and exit
|
||||
die()
|
||||
{
|
||||
exec 1>&2
|
||||
echo
|
||||
echo "Error encountered:"
|
||||
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
||||
echo
|
||||
echo "See '${0##*/} -help' for usage"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
searchDirs="$FOAM_APPBIN"
|
||||
optHeader=true
|
||||
unset outputFile
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
-d | -dir)
|
||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||
searchDirs="$2"
|
||||
[ -d "$searchDirs" ] || die "directory not found '$searchDirs'"
|
||||
shift
|
||||
;;
|
||||
-u | -user)
|
||||
searchDirs="$searchDirs $FOAM_USER_APPBIN"
|
||||
;;
|
||||
-no-head*)
|
||||
optHeader=false
|
||||
;;
|
||||
-o | -output)
|
||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||
outputFile="$2"
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
usage "unknown option: '$1'"
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
: ${outputFile:=$defaultOutputFile}
|
||||
|
||||
# Verify that output is writeable
|
||||
if [ -e "$outputFile" ]
|
||||
then
|
||||
[ -f "$outputFile" ] || \
|
||||
die "Cannot overwrite $outputFile" "Not a file"
|
||||
[ -w "$outputFile" ] || \
|
||||
die "Cannot overwrite $outputFile" "No permission?"
|
||||
else
|
||||
[ -w "$(dirname $outputFile)" ] || \
|
||||
die "Cannot write $outputFile" "directory is not writeble"
|
||||
fi
|
||||
|
||||
exec 1>| $outputFile || exit $?
|
||||
echo "Writing $outputFile" 1>&2
|
||||
echo 1>&2
|
||||
|
||||
# Header not disabled
|
||||
[ "$optHeader" = true ] && cat << HEADER
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# Cached options for bash completion of OpenFOAM applications.
|
||||
# These are the values expected by the '_of_complete_' function
|
||||
#
|
||||
# Recreate with "${0##*/}"
|
||||
|
||||
# Global associative array (cached options for OpenFOAM applications)
|
||||
declare -gA _of_complete_cache_;
|
||||
|
||||
# Clear existing cache.
|
||||
_of_complete_cache_=()
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
HEADER
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Scans the output of the application -help to detect options with/without
|
||||
# arguments. Dispatch via _of_complete_
|
||||
#
|
||||
extractOptions()
|
||||
{
|
||||
local appName="$1"
|
||||
local helpText=$($appName -help 2>/dev/null | sed -ne '/^ *-/p')
|
||||
|
||||
[ -n "$helpText" ] || {
|
||||
echo "Error calling $appName" 1>&2
|
||||
return 1
|
||||
}
|
||||
|
||||
# Array of options with args
|
||||
local argOpts=($(awk '/^ {0,4}-[a-z]/ && /</ {print $1}' <<< "$helpText"))
|
||||
|
||||
# Array of options without args
|
||||
local boolOpts=($(awk '/^ {0,4}-[a-z]/ && !/</ {print $1}' <<< "$helpText"))
|
||||
|
||||
appName="${appName##*/}"
|
||||
echo "$appName" 1>&2
|
||||
echo "_of_complete_cache_[${appName}]=\"${argOpts[@]} | ${boolOpts[@]}\""
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
[ "$#" -gt 0 ] || set -- ${searchDirs}
|
||||
|
||||
for item
|
||||
do
|
||||
if [ -d "$item" ]
|
||||
then
|
||||
# Process directory for applications - sort with ignore-case
|
||||
echo "[directory] $item" 1>&2
|
||||
choices="$(find $item -maxdepth 1 -executable -type f | sort -f 2>/dev/null)"
|
||||
for appName in $choices
|
||||
do
|
||||
extractOptions $appName
|
||||
done
|
||||
elif command -v "$item" > /dev/null 2>&1
|
||||
then
|
||||
extractOptions $item
|
||||
else
|
||||
echo "No such file or directory: $item" 1>&2
|
||||
fi
|
||||
done
|
||||
|
||||
# Generate footer
|
||||
[ "$optHeader" = true ] && cat << FOOTER
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
FOOTER
|
||||
|
||||
#------------------------------------------------------------------------------
|
@ -1,59 +0,0 @@
|
||||
#!bash
|
||||
# A bash -*- sh -*- adapter for re-using OpenFOAM bash completions with tcsh
|
||||
#
|
||||
# Called with appName and COMMAND_LINE
|
||||
#
|
||||
# Source the bash completions
|
||||
. $WM_PROJECT_DIR/etc/config.sh/bash_completion
|
||||
|
||||
appName=$1
|
||||
|
||||
# Ensure COMP_LINE is available for bash function
|
||||
if [ "$#" -eq 2 ]
|
||||
then
|
||||
COMP_LINE=$2
|
||||
else
|
||||
COMP_LINE=$COMMAND_LINE
|
||||
fi
|
||||
|
||||
# Remove the colon as a completion separator because tcsh cannot handle it
|
||||
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
|
||||
|
||||
# Set COMP_WORDS in a way that can be handled by the bash script.
|
||||
COMP_WORDS=($COMP_LINE)
|
||||
|
||||
# The cursor is at the end of parameter #1.
|
||||
# We must check for a space as the last character which will
|
||||
# tell us that the previous word is complete and the cursor
|
||||
# is on the next word.
|
||||
if [ "${COMP_LINE: -1}" = " " ]
|
||||
then
|
||||
# The last character is a space, so our location is at the end
|
||||
# of the command-line array
|
||||
COMP_CWORD=${#COMP_WORDS[@]}
|
||||
else
|
||||
# The last character is not a space, so our location is on the
|
||||
# last word of the command-line array, so we must decrement the
|
||||
# count by 1
|
||||
COMP_CWORD=$((${#COMP_WORDS[@]}-1))
|
||||
fi
|
||||
|
||||
# bash completions are "complete ... -F _of_APPNAME APPNAME
|
||||
_of_${appName} \
|
||||
"$appName" "${COMP_WORDS[COMP_CWORD]}" "${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
# Need slash on the end of directories for tcsh
|
||||
reply=($(for i in ${COMPREPLY[@]}
|
||||
do
|
||||
if [ -d "$i" -a "${i#/}" = "$i" ]
|
||||
then
|
||||
echo "$i/"
|
||||
else
|
||||
echo "$i"
|
||||
fi
|
||||
done
|
||||
))
|
||||
|
||||
echo ${reply[@]}
|
||||
|
||||
#------------------------------------------------------------------------------
|
93
etc/config.csh/complete-wrapper
Normal file
93
etc/config.csh/complete-wrapper
Normal file
@ -0,0 +1,93 @@
|
||||
#!bash
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# This file is part of OpenFOAM, licensed under the GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# etc/config.csh/complete-wrapper
|
||||
#
|
||||
# Description
|
||||
# A wrapper for using OpenFOAM bash completions with tcsh.
|
||||
#
|
||||
# Arguments
|
||||
# appName = the application name
|
||||
#
|
||||
# Environment
|
||||
# The tcsh COMMAND_LINE is passed in via the environment.
|
||||
# This corresponds to the bash COMP_LINE variable
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
[ "$#" -ge 1 ] || exit 1
|
||||
|
||||
# Preload completion cache
|
||||
if [ -f $WM_PROJECT_DIR/etc/config.sh/completion_cache ]
|
||||
then . $WM_PROJECT_DIR/etc/config.sh/completion_cache
|
||||
fi
|
||||
|
||||
# Use the bash completion function, but retain cache etc.
|
||||
_of_complete_tcsh=true
|
||||
if [ -f $WM_PROJECT_DIR/etc/config.sh/bash_completion ]
|
||||
then . $WM_PROJECT_DIR/etc/config.sh/bash_completion
|
||||
else
|
||||
# Could warn about missing file, or treat silently
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
appName=$1
|
||||
|
||||
# Ensure COMP_LINE is available for bash function
|
||||
if [ "$#" -eq 2 ]
|
||||
then
|
||||
COMP_LINE=$2
|
||||
else
|
||||
COMP_LINE=$COMMAND_LINE
|
||||
fi
|
||||
|
||||
# Remove the colon as a completion separator because tcsh cannot handle it
|
||||
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
|
||||
|
||||
# Set COMP_WORDS in a way that can be handled by the bash script.
|
||||
COMP_WORDS=($COMP_LINE)
|
||||
|
||||
# The cursor is at the end of parameter #1.
|
||||
# We must check for a space as the last character which will
|
||||
# tell us that the previous word is complete and the cursor
|
||||
# is on the next word.
|
||||
if [ "${COMP_LINE: -1}" = " " ]
|
||||
then
|
||||
# The last character is a space, so our location is at the end
|
||||
# of the command-line array
|
||||
COMP_CWORD=${#COMP_WORDS[@]}
|
||||
else
|
||||
# The last character is not a space, so our location is on the
|
||||
# last word of the command-line array, so we must decrement the
|
||||
# count by 1
|
||||
COMP_CWORD=$((${#COMP_WORDS[@]}-1))
|
||||
fi
|
||||
|
||||
# Call _of_complete_ APPNAME Current Previous
|
||||
_of_complete_ \
|
||||
"$appName" "${COMP_WORDS[COMP_CWORD]}" "${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
# Tcsh needs slash on the end of directories
|
||||
reply=($(for i in ${COMPREPLY[@]}
|
||||
do
|
||||
if [ -d "$i" -a "${i#/}" = "$i" ]
|
||||
then
|
||||
echo "$i/"
|
||||
else
|
||||
echo "$i"
|
||||
fi
|
||||
done
|
||||
))
|
||||
|
||||
echo ${reply[@]}
|
||||
|
||||
#------------------------------------------------------------------------------
|
@ -3,15 +3,23 @@
|
||||
# Using bash_completion functions for the hard work
|
||||
|
||||
if ($?tcsh) then # tcsh only
|
||||
if ( -f $WM_PROJECT_DIR/etc/config.sh/bash_completion \
|
||||
&& -f $WM_PROJECT_DIR/etc/config.csh/complete) then
|
||||
foreach appName (`sed -ne 's/^complete.* //p' $WM_PROJECT_DIR/etc/config.sh/bash_completion`)
|
||||
|
||||
# Remove old completions, which look like:
|
||||
# complete APPNAME 'p,*,`bash $WM_PROJECT_DIR/etc/ ...
|
||||
foreach appName (`complete | sed -ne '/WM_PROJECT/s/\t.*$//p'`)
|
||||
uncomplete $cleaned
|
||||
end
|
||||
|
||||
# Generate completions for predefined directories
|
||||
foreach dirName ("$FOAM_APPBIN")
|
||||
if ( ! -d $dirName || ! -f $WM_PROJECT_DIR/etc/config.csh/complete-wrapper ) continue
|
||||
foreach appName (`find $dirName -maxdepth 1 -executable -type f`)
|
||||
# Pass explicitly
|
||||
## complete $appName 'p,*,`bash $WM_PROJECT_DIR/etc/config.csh/complete '$appName' "${COMMAND_LINE}"`,'
|
||||
## complete $appName:t 'p,*,`bash $WM_PROJECT_DIR/etc/config.csh/complete-wrapper '$appName:t' "${COMMAND_LINE}"`,'
|
||||
# Pass via environment
|
||||
complete $appName 'p,*,`bash $WM_PROJECT_DIR/etc/config.csh/complete '$appName'`,'
|
||||
complete $appName:t 'p,*,`bash $WM_PROJECT_DIR/etc/config.csh/complete-wrapper '$appName:t'`,'
|
||||
end
|
||||
endif
|
||||
end
|
||||
endif
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -196,11 +196,10 @@ unalias wmRefresh
|
||||
unalias foamVersion
|
||||
unalias foamPV
|
||||
|
||||
# Cleanup completions, which look like this:
|
||||
# complete blockMesh 'p,*,`bash $WM_PROJECT_DIR/etc/ ...
|
||||
|
||||
# Remove old completions, which look like:
|
||||
# complete APPNAME 'p,*,`bash $WM_PROJECT_DIR/etc/ ...
|
||||
if ($?prompt && $?tcsh) then # Interactive tcsh only
|
||||
foreach cleaned (`complete | sed -n -e '/WM_PROJECT/s/\t.*$//p'`)
|
||||
foreach cleaned (`complete | sed -ne '/WM_PROJECT/s/\t.*$//p'`)
|
||||
uncomplete $cleaned
|
||||
end
|
||||
endif
|
||||
|
File diff suppressed because it is too large
Load Diff
259
etc/config.sh/completion_cache
Normal file
259
etc/config.sh/completion_cache
Normal file
@ -0,0 +1,259 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# Cached options for bash completion of OpenFOAM applications.
|
||||
# These are the values expected by the '_of_complete_' function
|
||||
#
|
||||
# Recreate with "foamCreateCompletionCache"
|
||||
|
||||
# Global associative array (cached options for OpenFOAM applications)
|
||||
declare -gA _of_complete_cache_;
|
||||
|
||||
# Clear existing cache.
|
||||
_of_complete_cache_=()
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
_of_complete_cache_[adiabaticFlameT]="-case | -srcDoc -doc -help"
|
||||
_of_complete_cache_[adjointShapeOptimizationFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[ansysToFoam]="-case -scale | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[applyBoundaryLayer]="-case -decomposeParDict -region -roots -ybl | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[attachMesh]="-case | -noFunctionObjects -overwrite -srcDoc -doc -help"
|
||||
_of_complete_cache_[autoPatch]="-case | -noFunctionObjects -overwrite -srcDoc -doc -help"
|
||||
_of_complete_cache_[blockMesh]="-case -dict -region | -blockTopology -noClean -noFunctionObjects -sets -srcDoc -doc -help"
|
||||
_of_complete_cache_[boundaryFoam]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[boxTurb]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[buoyantBoussinesqPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[buoyantBoussinesqSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[buoyantPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[buoyantSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[cavitatingDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[cavitatingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[cfx4ToFoam]="-case -scale | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[changeDictionary]="-case -decomposeParDict -dict -instance -region -roots -subDict -time | -constant -disablePatchGroups -enableFunctionEntries -latestTime -literalRE -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[checkMesh]="-case -decomposeParDict -region -roots -time -writeFields -writeSets | -allGeometry -allTopology -constant -latestTime -meshQuality -newTimes -noFunctionObjects -noTopology -noZero -parallel -writeAllFields -srcDoc -doc -help"
|
||||
_of_complete_cache_[chemFoam]="-case | -noFunctionObjects -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[chemkinToFoam]="-case | -newFormat -srcDoc -doc -help"
|
||||
_of_complete_cache_[chtMultiRegionFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[chtMultiRegionSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[coalChemistryFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[coldEngineFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[collapseEdges]="-case -collapseFaceSet -decomposeParDict -dict -roots -time | -collapseFaces -constant -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[combinePatchFaces]="-case -concaveAngle -decomposeParDict -roots | -meshQuality -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[compressibleInterDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[compressibleInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[compressibleMultiphaseInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[createBaffles]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[createExternalCoupledPatchGeometry]="-case -commsDir -decomposeParDict -region -regions -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[createPatch]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -overwrite -parallel -writeObj -srcDoc -doc -help"
|
||||
_of_complete_cache_[createZeroDirectory]="-case -decomposeParDict -roots -templateDir | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[datToFoam]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[decomposePar]="-case -decomposeParDict -region -time | -allRegions -cellDist -constant -copyUniform -copyZero -fields -force -ifRequired -latestTime -newTimes -noFunctionObjects -noSets -noZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[deformedGeom]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[dnsFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[DPMDyMFoam]="-case -cloudName -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[DPMFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[driftFluxFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[dsmcFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[dsmcInitialise]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[electrostaticFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[engineCompRatio]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[engineFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[engineSwirl]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[equilibriumCO]="-case | -srcDoc -doc -help"
|
||||
_of_complete_cache_[equilibriumFlameT]="-case | -srcDoc -doc -help"
|
||||
_of_complete_cache_[extrude2DMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[extrudeMesh]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[extrudeToRegionMesh]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[faceAgglomerate]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[financialFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[fireFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[fireToFoam]="-case -scale | -ascii -check -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[flattenMesh]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[fluent3DMeshToFoam]="-case -ignoreCellGroups -ignoreFaceGroups -scale | -cubit -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[fluentMeshToFoam]="-case -scale | -noFunctionObjects -writeSets -writeZones -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamDataToFluent]="-case -time | -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamDictionary]="-add -case -decomposeParDict -diff -entry -roots -set | -disableFunctionEntries -expand -includes -keywords -noFunctionObjects -parallel -remove -value -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamFormatConvert]="-case -decomposeParDict -region -roots -time | -constant -enableFunctionEntries -latestTime -newTimes -noConstant -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamHelp]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamList]="-case -scalarBCs -vectorBCs | -compressibleTurbulenceModels -functionObjects -fvOptions -incompressibleTurbulenceModels -noFunctionObjects -registeredSwitches -switches -unset -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamListTimes]="-case -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -processor -rm -withZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamMeshToFluent]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamToEnsight]="-case -cellZone -decomposeParDict -faceZones -fields -name -patches -region -roots -time -width | -ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noPatches -noZero -nodeValues -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamToEnsightParts]="-case -index -name -time -width | -ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noMesh -noZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamToFireMesh]="-case -scale -time | -ascii -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamToGMV]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamToStarMesh]="-case -scale -time | -constant -latestTime -newTimes -noBnd -noFunctionObjects -noZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamToSurface]="-case -scale -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -tri -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamToTecplot360]="-case -cellSet -decomposeParDict -excludePatches -faceSet -fields -region -roots -time | -constant -latestTime -nearCellValue -newTimes -noFaceZones -noFunctionObjects -noInternal -noPointValues -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamToTetDualMesh]="-case -decomposeParDict -roots -time | -constant -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamToVTK]="-case -cellSet -decomposeParDict -excludePatches -faceSet -fields -name -pointSet -region -roots -time | -allPatches -ascii -constant -latestTime -nearCellValue -newTimes -noFaceZones -noFunctionObjects -noInternal -noLagrangian -noLinks -noPointValues -noZero -parallel -poly -surfaceFields -useTimeName -xml -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamUpgradeCyclics]="-case -decomposeParDict -region -roots -time | -constant -enableFunctionEntries -latestTime -newTimes -noFunctionObjects -noZero -parallel -test -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamyHexMesh]="-case -decomposeParDict -roots | -checkGeometry -conformationOnly -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[foamyQuadMesh]="-case -pointsFile | -noFunctionObjects -overwrite -srcDoc -doc -help"
|
||||
_of_complete_cache_[gambitToFoam]="-case -scale | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[gmshToFoam]="-case -region | -keepOrientation -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[icoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[icoUncoupledKinematicParcelDyMFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[icoUncoupledKinematicParcelFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[ideasUnvToFoam]="-case | -dump -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[insideCells]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[interCondensatingEvaporatingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[interDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[interFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[interIsoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[interMixingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[interPhaseChangeDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[interPhaseChangeFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[kivaToFoam]="-case -file -version -zHeadMin | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[laplacianFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[lumpedPointForces]="-case -decomposeParDict -region -roots -time | -constant -latestTime -newTimes -noZero -parallel -vtk -srcDoc -doc -help"
|
||||
_of_complete_cache_[lumpedPointMovement]="-case -max -scale -span | -removeLock -slave -srcDoc -doc -help"
|
||||
_of_complete_cache_[lumpedPointZones]="-case -region | -verbose -srcDoc -doc -help"
|
||||
_of_complete_cache_[magneticFoam]="-case -decomposeParDict -roots | -noB -noFunctionObjects -noH -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[mapFields]="-case -mapMethod -sourceDecomposeParDict -sourceRegion -sourceTime -targetDecomposeParDict -targetRegion | -consistent -noFunctionObjects -parallelSource -parallelTarget -subtract -srcDoc -doc -help"
|
||||
_of_complete_cache_[mapFieldsPar]="-case -decomposeParDict -fields -mapMethod -patchMapMethod -roots -sourceRegion -sourceTime -targetRegion | -consistent -noFunctionObjects -noLagrangian -parallel -subtract -srcDoc -doc -help"
|
||||
_of_complete_cache_[mdEquilibrationFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[mdFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[mdInitialise]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[mergeMeshes]="-addRegion -case -decomposeParDict -masterRegion -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[mergeOrSplitBaffles]="-case -decomposeParDict -dict -region -roots | -detectOnly -noFunctionObjects -overwrite -parallel -split -srcDoc -doc -help"
|
||||
_of_complete_cache_[mhdFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[mirrorMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[mixtureAdiabaticFlameT]="-case | -srcDoc -doc -help"
|
||||
_of_complete_cache_[modifyMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[moveDynamicMesh]="-case -decomposeParDict -region -roots | -checkAMI -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[moveEngineMesh]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[moveMesh]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[MPPICDyMFoam]="-case -cloudName -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[MPPICFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[MPPICInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[mshToFoam]="-case | -hex -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[multiphaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[multiphaseInterDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[multiphaseInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[netgenNeutralToFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[noise]="-case -decomposeParDict -dict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[nonNewtonianIcoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[objToVTK]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[orientFaceZone]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[overInterDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[overLaplacianDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[overPimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[overRhoPimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[overSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[particleTracks]="-case -decomposeParDict -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[patchSummary]="-case -decomposeParDict -region -roots -time | -constant -expand -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[pdfPlot]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[PDRFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[PDRMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[pimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[pimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[pisoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[plot3dToFoam]="-case -scale | -noBlank -noFunctionObjects -singleBlock -srcDoc -doc -help"
|
||||
_of_complete_cache_[polyDualMesh]="-case | -concaveMultiCells -doNotPreserveFaceZones -noFunctionObjects -overwrite -splitAllFaces -srcDoc -doc -help"
|
||||
_of_complete_cache_[porousSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[postChannel]="-case -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[postProcess]="-case -decomposeParDict -dict -field -fields -func -funcs -region -roots -time | -constant -latestTime -list -newTimes -noFunctionObjects -noZero -parallel -profiling -srcDoc -doc -help"
|
||||
_of_complete_cache_[potentialFoam]="-case -decomposeParDict -pName -roots | -initialiseUBCs -noFunctionObjects -parallel -withFunctionObjects -writePhi -writep -srcDoc -doc -help"
|
||||
_of_complete_cache_[potentialFreeSurfaceDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[potentialFreeSurfaceFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[reactingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[reactingMultiphaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[reactingParcelFilmFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[reactingParcelFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[reactingTwoPhaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[reconstructPar]="-case -fields -lagrangianFields -region -time | -allRegions -constant -latestTime -newTimes -noFields -noFunctionObjects -noLagrangian -noSets -noZero -withZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[reconstructParMesh]="-case -mergeTol -region -time | -cellDist -constant -fullMatch -latestTime -newTimes -noFunctionObjects -noZero -withZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[redistributePar]="-case -decomposeParDict -mergeTol -region -roots -time | -cellDist -constant -decompose -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -reconstruct -withZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[refineHexMesh]="-case -decomposeParDict -region -roots | -minSet -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[refinementLevel]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -readLevel -srcDoc -doc -help"
|
||||
_of_complete_cache_[refineMesh]="-case -decomposeParDict -dict -region -roots | -all -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[refineWallLayer]="-case -decomposeParDict -roots -useSet | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[removeFaces]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[renumberMesh]="-case -decomposeParDict -dict -region -roots -time | -constant -frontWidth -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[rhoCentralDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[rhoCentralFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[rhoPimpleAdiabaticFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[rhoPimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[rhoPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[rhoPorousSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[rhoReactingBuoyantFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[rhoReactingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[rhoSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[rotateMesh]="-case -decomposeParDict -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[scalarTransportFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[selectCells]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[setAlphaField]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[setFields]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[setSet]="-batch -case -decomposeParDict -region -roots -time | -constant -latestTime -loop -newTimes -noFunctionObjects -noSync -noVTK -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[setsToZones]="-case -decomposeParDict -region -roots -time | -constant -latestTime -newTimes -noFlipMap -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[shallowWaterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[simpleCoalParcelFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[simpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[simpleReactingParcelFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[singleCellMesh]="-case -decomposeParDict -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[smapToFoam]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[snappyHexMesh]="-case -decomposeParDict -dict -outFile -patches -region -roots -surfaceSimplify | -checkGeometry -noFunctionObjects -overwrite -parallel -profiling -srcDoc -doc -help"
|
||||
_of_complete_cache_[snappyRefineMesh]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[solidDisplacementFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[solidEquilibriumDisplacementFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[sonicDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[sonicFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[sonicLiquidFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[splitCells]="-case -set -tol | -geometry -noFunctionObjects -overwrite -srcDoc -doc -help"
|
||||
_of_complete_cache_[splitMesh]="-case | -noFunctionObjects -overwrite -srcDoc -doc -help"
|
||||
_of_complete_cache_[splitMeshRegions]="-blockedFaces -case -cellZonesFileOnly -decomposeParDict -insidePoint -region -roots | -cellZones -cellZonesOnly -detectOnly -largestOnly -makeCellZones -noFunctionObjects -overwrite -parallel -prefixRegion -sloppyCellZones -useFaceZones -srcDoc -doc -help"
|
||||
_of_complete_cache_[sprayDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[sprayEngineFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[sprayFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[SRFPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[SRFSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[star4ToFoam]="-case -scale | -ascii -noFunctionObjects -solids -srcDoc -doc -help"
|
||||
_of_complete_cache_[steadyParticleTracks]="-case -dict -region -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help"
|
||||
_of_complete_cache_[stitchMesh]="-case -region -toleranceDict | -noFunctionObjects -overwrite -partial -perfect -srcDoc -doc -help"
|
||||
_of_complete_cache_[subsetMesh]="-case -decomposeParDict -patch -patches -region -resultTime -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceAdd]="-case -points | -mergeRegions -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceBooleanFeatures]="-case -trim | -invertedSpace -noFunctionObjects -perturb -surf1Baffle -surf2Baffle -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceCheck]="-case -outputThreshold | -blockMesh -checkSelfIntersection -noFunctionObjects -splitNonManifold -verbose -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceClean]="-case | -noClean -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceCoarsen]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceConvert]="-case -scale -writePrecision | -clean -group -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceFeatureConvert]="-case -scale | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceFeatureExtract]="-case -dict | -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceFind]="-case -x -y -z | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceHookUp]="-case -dict | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceInertia]="-case -density -referencePoint | -noFunctionObjects -shellProperties -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceInflate]="-case -featureAngle -nSmooth | -checkSelfIntersection -debug -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceLambdaMuSmooth]="-featureFile | -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceMeshConvert]="-case -dict -from -scaleIn -scaleOut -to | -clean -noFunctionObjects -tri -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceMeshConvertTesting]="-case -scale | -clean -noFunctionObjects -orient -stdout -surfMesh -testModify -triFace -triSurface -unsorted -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceMeshExport]="-case -dict -from -name -scaleIn -scaleOut -to | -clean -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceMeshImport]="-case -dict -from -name -scaleIn -scaleOut -to | -clean -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceMeshInfo]="-case -scale | -areas -noFunctionObjects -xml -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceMeshTriangulate]="-case -decomposeParDict -faceZones -patches -region -roots -time | -constant -excludeProcPatches -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceOrient]="-case | -inside -noFunctionObjects -usePierceTest -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfacePatch]="-case -dict | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfacePointMerge]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceRedistributePar]="-case -decomposeParDict -roots | -keepNonMapped -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceRefineRedGreen]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceSplitByPatch]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceSplitByTopology]=" | -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceSplitNonManifolds]="-case | -debug -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceSubset]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceToPatch]="-case -faceSet -tol | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[surfaceTransformPoints]="-case -rollPitchYaw -rotate -scale -translate -yawPitchRoll | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[temporalInterpolate]="-case -decomposeParDict -divisions -fields -interpolationType -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[tetgenToFoam]="-case -decomposeParDict -roots | -noFaceFile -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[thermoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[topoSet]="-case -decomposeParDict -dict -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noSync -noZero -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[transformPoints]="-case -decomposeParDict -region -rollPitchYaw -roots -rotate -scale -translate -yawPitchRoll | -noFunctionObjects -parallel -rotateFields -srcDoc -doc -help"
|
||||
_of_complete_cache_[twoLiquidMixingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[twoPhaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[uncoupledKinematicParcelFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[viewFactorsGen]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[vtkUnstructuredToFoam]="-case | -noFunctionObjects -srcDoc -doc -help"
|
||||
_of_complete_cache_[wallFunctionTable]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
_of_complete_cache_[writeMeshObj]="-case -cell -cellSet -decomposeParDict -face -faceSet -point -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -patchEdges -patchFaces -srcDoc -doc -help"
|
||||
_of_complete_cache_[XiDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[XiFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
|
||||
_of_complete_cache_[zipUpMesh]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
|
||||
|
||||
#------------------------------------------------------------------------------
|
@ -181,16 +181,21 @@ unset -f wmRefresh 2>/dev/null
|
||||
unset -f foamVersion 2>/dev/null
|
||||
unset -f foamPV 2>/dev/null
|
||||
|
||||
# Cleanup bash completions, which look like this:
|
||||
# "complete ... -F _of_APPNAME APPNAME
|
||||
# For economy, obtain list first but also remove the 'of_complete_' backend
|
||||
foamClean="$(complete 2>/dev/null | sed -n -e 's/complete.*-F _of_.* \(..*\)$/\1/p')"
|
||||
for cleaned in $foamClean complete_
|
||||
# Remove old completions, which look like
|
||||
# "complete ... -F _of_complete_ APPNAME
|
||||
# For economy, obtain list first
|
||||
foamOldDirs="$(complete 2>/dev/null | sed -ne 's/^.*-F _of_.* \(..*\)$/\1/p')"
|
||||
for cleaned in $foamOldDirs
|
||||
do
|
||||
unset -f _of_$cleaned 2>/dev/null
|
||||
complete -r $cleaned 2>/dev/null
|
||||
complete -r $cleaned 2>/dev/null
|
||||
done
|
||||
|
||||
# Completion functions
|
||||
unset -f foamAddCompletion 2>/dev/null
|
||||
unset -f _of_complete_ 2>/dev/null
|
||||
|
||||
# Completion cache
|
||||
unset _of_complete_cache_
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Intermediate variables (do as last for a clean exit code)
|
||||
|
Loading…
Reference in New Issue
Block a user