4 Commits

Author SHA1 Message Date
5ec32f5701 bin/foamFind: fixed -help option 2024-06-28 14:25:19 +01:00
f9ac53aab4 bin/foamFind: added '-edit' option to open file in a text editor
The editor must be specified by configuring the EDITOR environment
variable. For example to use the 'gedit' editor, the following entry
could be added to the user's .bashrc file:

export EDITOR=gedit
2024-04-19 20:53:00 +01:00
2e9e37d67c bin/foamFind: fixed typo in header 2024-04-19 09:17:06 +01:00
1c6d785c1c foamFind: script to find files in OpenFOAM and optionally process the contents
by printing their contents or lines which match a search string.

Usage: ${0##*/} [OPTIONS] <filename>
options:
  -a | -applications     search for the file from the \$FOAM_APP directory
  -d | -dir <dir>        specify search directory
  -f | -files            find wmake 'files' file associated with searched file
  -h | -help             help
  -i | -isearch <string> searches files for a <string>, case insensitive
  -m | -modules          search for the file from the \$FOAM_MODULES directory
  -n | -numbers          print line numbers with file output
  -o | -options          find wmake 'options' file associated with searched file
  -p | -print            print the file(s)
  -s | -search <string>  searches files for a <string>, case sensitive
  -t | -tutorials        search for the file from the \$FOAM_TUTORIALS directory

Finds one or more files in OpenFOAM and optionally processes the contents by:
+ printing the file ('-print' option);
+ printing lines within the file matching a search string ('-search' option).

With source code files, can locate the 'files' and 'options' files associated
with their compilation using 'wmake'.

By default, files are searched from the src (\$FOAM_SRC) directory.
Alternatively the '-dir' option allows the user to specify the search directory
The '-applications', '-modules' and '-tutorials' options specifically set the
search path to the \$FOAM_APP, \$FOAM_MODULES and \$FOAM_TUTORIALS directories,
respectively.

Examples:
    foamFind -print wallHeatFlux.C | less
    + click space bar to scroll down
    + enter line number (after ":") to jump to line
    + enter "/text" to search for "text" (or any other string)

    foamFind -applications -isearch "momentumtransport" -options fluid.C
    foamFind -numbers -search laminar BirdCarreau.C
2024-04-05 13:28:41 +01:00