Commit Graph

21 Commits

Author SHA1 Message Date
Mark Olesen
b2217d5e6b ENH: simplify inheritances for fileOperationInitialise
- can be broadly categorised as 'unthreaded'
  or 'collated' (threading requirement depends on buffering)
  without other opaque inheritances.

CONFIG: add hostUncollated to bash completion prompt
2023-06-19 17:05:45 +02:00
Mark Olesen
24ffc5236d COMP: simplify openmp handling (#2617)
- remove old, unneeded -DUSE_OMP define.
- wmake -no-openmp option to add '~openmp' to WM_COMPILE_CONTROL

ENH: add bash completion handling for wmake
2022-10-26 18:04:56 +02:00
Mark Olesen
614db5a1e2 STYLE: adjust 'No completions' message for more clarification
- Now state "[ignore if OpenFOAM is not yet compiled]"
2020-05-14 11:20:49 +02:00
Mark Olesen
f30b0895e8 CONFIG: prevent bash completions from examining the description notes 2019-11-25 18:38:39 +01:00
Mark Olesen
e6dfb39c66 STYLE: remove unnecessary stdout, stderr /dev/null redirects
- no stderr redirect needed:
    * 'command -v'

- no stdout/stderr redirect needed:
    * 'rm -f'

STYLE: consistent spacing after redirects
2019-11-06 10:44:36 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
a66e9c7468 ENH: adjust completion parser
- restrict to text between "^[Oo]ptions:" and "-help-full" to avoid
  potential issues when more text is introduced in the usage output.
2018-12-12 03:07:14 +01:00
Mark Olesen
5187aa13aa ENH: improve output formatting for usage information
- generalize output text wrapping, use for usage notes

- add -help-man option for generating manpage content for any OpenFOAM
  application or solver.

  bin/tools/foamCreateManpage as helper
2018-11-21 19:55:28 +01:00
Mark Olesen
31c21031ea ENH: reduce intermediate text with generating completion options
- more filtering in the sed stage to remove non-essential text.
  Terminate parsing on first appearance of -help-full option.
2018-11-21 10:51:57 +01:00
Mark Olesen
50852b3392 CONFIG: improve shell env handling of paths with spaces (#1007, #1008)
- foamCleanPath now only splits the environment variable on ':', which
  allows other directories with spaces or '(..)' etc to pass through
  without major issue.

- The filter arguments are split on whitespace, colons or semi-colons.
2018-10-15 21:37:46 +02:00
Mark Olesen
53b0bb0782 CONFIG: fix odd behaviour in bash completion (issue #1011)
- The test condition

      [ -n "$cur" -a ... ]

  fails if $cur starts with '-le', which bash interprets as a further
  test op. Splitting the test condition solves the problem:

      [ -n "$cur" ] && [ ... ]
2018-09-18 18:25:29 +02:00
Mark Olesen
c611bd6f94 CONFIG: add hostCollated for -fileHandler completion
- in anticipation of future change,
  hard-coded choice within bash_completion
2018-06-07 15:43:46 +02:00
Mark Olesen
f86c129fd5 STYLE: additional comment when completion not found (issue #719)
No completion added for XXX
    ... incorrect platform, or not yet compiled?
2018-04-30 07:50:48 +02:00
Mark Olesen
110b00f048 ENH: improved handling of gmp/mpfr library settings (issue #674)
- export library path for gmp/mpfr from CGAL config files.
  This is required when non-system gmp/mpfr libraries are being
  used, but not using a ThirdParty compiler installation.

- automatically handle lib/ vs lib64/ (eg, for central installations)
  for packages such as boost, CGAL, etc. While the ThirdParty
  compilation of these will normally land in lib64/, this may not be
  the case when they are supplied by another means.

- reworked the handling of foamEtcFile and foamCleanPath for less
  clutter in the configuration files.
  Added the bin/tools/lib-dir script to handle logic that is
  too complex to easily manage in csh.
2018-01-11 01:30:23 +01:00
Mark Olesen
19c3875a14 CONFIG: update tcsh completion_cache to include finiteArea and cfmesh
- include bash completion for paraFoam, and provision for using
  foamEtcFile as well.
2017-12-18 14:26:49 +01:00
Mark Olesen
05a8fe5dd3 STYLE: compact license text in config files for easier reading/editing 2017-11-20 09:00:10 +01:00
Mark Olesen
5947f9a337 ENH: more succinct output from command-line errors.
- unknown options or missing option values now emit a shorter message
  without the entire usage. This makes it easier to identify the errors
  and is better aligned with the behaviour of GNU system tools.

  ====
     $ simpleFoam -case
     Using: OpenFOAM-plus (see www.OpenFOAM.com)
     Build: plus-01234

     Error: option '-case' requires an argument

     See 'simpleFoam -help' for usage
  ====

- provide for reduced (-help) and full (-help-full) usage information.
  In many cases the reduced usage provided sufficient and easier
  to find the information.

- make -srcDoc an alias for -doc-source

- no warnings about option aliases for future dates.
2017-11-24 10:27:11 +01:00
Mark Olesen
92d1d1f037 CONFIG: verify bash version for completion support
- the (global) associative array requires bash >= 4.2
2017-08-10 10:05:22 +02:00
Mark Olesen
ce0868106a 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
2017-08-08 13:17:36 +02:00
Mark Olesen
78da7dbd7a CONFIG: additional filenames completion for bash_completion
- handles the case where we are currently completing something that
  does not appear to be an option. For example,

      foamDictionary -expanded someD[TAB]

  should complete the filename, not present more options.
2017-08-03 10:47:42 +02:00
Mark Olesen
c614110d46 ENH: improve bash completion functionality (issue #551)
- use complete -o filenames, dropped -o nospace to make it more responsive.

- restructure completion code to use a unified backend, which makes it easier
  understand, maintain and re-use.

- foamCreateBashCompletions now simply outputs to a stdout, and allows
  quick generation of completion of single applications.

- add -fileHandler completion in anticipation of future changes there.

- relocated as etc/config.s/bash_completion to prevent inadvertently
  having two versions (.com, .org) installed at the same time.
2017-07-31 15:35:40 +02:00