![]() |
PUMA Library Reference Manual
|
Several aspects of the functionality of PUMA can be configured using command line options or a configuration file. The following configuration options are understood by the library.
| Option | Description |
|---|---|
| -p, –path PATH | Add a project source directory |
| -d, –dest PATH | Add a destination folder for modified sources |
| -w, –write-protected PATH | Add a write protected project directory |
| -e, –extension STRING | Set the extension for source files |
| -s, –suffix STRING | Set the suffix for output files |
| –config FILE | Load configuration options from a file |
| –system-config FILE | Load low precedence configuration options from a file |
| –save-new-suffix | Append new suffix on existing files when saving |
| –save-overwrite | Overwrite existing files when saving |
| –save-rename-old | Rename existing files when saving |
| Option | Description |
|---|---|
| -A PREDICATE(ANSWER) | Assert a preprocessor predicate, e.g. -Asystem(linux) |
| -D NAME[=BODY] | Define a preprocessor macro, e.g. -DSYSTEM=linux or -D DEBUG |
| -U NAME | Undefine a preprocessor macro, e.g. -U SYSTEM |
| -I PATH | Add a non-system include directory |
| –isystem PATH | Add a system include directory |
| –include FILE | Include the given file at the beginning of each source file |
| –lock-macro NAME[=BODY] | Define an immutable preprocessor macro |
| –inhibit-macro NAME | Add the name of a macro whose definition will be ignored |
| Option | Description |
|---|---|
| –lang-c | Set input language to C |
| –lang-ec++ | Set input language to Embedded C++ |
| –lang-c++ | Set input language to C++ |
| –size-type TYPE | Set the internal type for size_t |
| –ptrdiff-type TYPE | Set the internal type for ptrdiff_t |
| –target TRIPLE | Set target triple which determines sizes and alignments for built-in types |
| –builtin-type-traits | Enable built-in type traits |
| –verbose-errors | Enable verbose error messages |
| –match-expr | Enable match expression language extensions |
| Option | Description |
|---|---|
| –skip-bodies-all | Don't parse function bodies |
| –skip-bodies-tpl | Don't parse function bodies of templates |
| –skip-bodies-non-prj | Don't parse function bodies in non-project files |
| –skip-bodies-non-prim | Don't parse function bodies in non-primary files |
| –pseudo-instances | Simplified template instantiation scheme (deprecated) |
| –inst-fct-bodies | Enable function template body instantiation |
| –template-depth DEPTH | Set the maximum instantiation depth for templates |
| Option | Description |
|---|---|
| –vc | Enable VisualC++ language extensions |
| –import-handler FILE | Set a handler for resolving #import directives |
| Option | Description |
|---|---|
| –gnu [VERSION] | Enable all GNU C/C++ language extensions (optionally version dependent) |
| –gnu-nested-fct | Enable GNU C/C++ nested functions |
| –gnu-condition-scope | Enable GNU C/C++ condition scope |
| –gnu-param-decl | Enable GNU C/C++ parameter declarator |
| –gnu-fct-decl | Enable GNU C/C++ function declarator |
| –gnu-param-scope | Enable GNU C/C++ function parameter scope |
| –gnu-default-args | Enable GNU C/C++ function default arguments |
| –gnu-extended-asm | Enable GNU C/C++ extended asm syntax |
| –gnu-extended-expr | Enable GNU C/C++ extended expressions |
| –gnu-long-long | Enable GNU C/C++ long long type |
| –gnu-int128 | Enable GNU type __int128 extension |
| –gnu-name-scope | Enable GNU C/C++ name scope |
| –gnu-implicit-int | Enable GNU implicit int extension |
| –gnu-fct-attribute | Enable GNU C/C++ function attributes |
| –gnu-if-then-expr | Enable GNU C/C++ if-then expression syntax |
| –gnu-std-hack | Enable GNU C/C++ implicit namespace std hack |
| –gnu-friend-injection | Enable GNU friend injection extension |
| –gnu-pic24 | Enable GNU PIC24 and dsPIC extension |
| Option | Description |
|---|---|
| –c++1x | Enable all C++1x language extensions |
| –c++1x-static-assert | Enable C++1x static assertions |
All command line options can also be specified in a configuration file. Each option in the configuration file has to start on a new line.
Lines beginning with # are interpreted as comments and will be ignored.
Arguments of options containing spaces have to be enclosed in double-quotes. Double-quotes in the argument have to be escaped.
All occurrences of ${Name} in the configuration file are interpreted as environment variables and replaced by their values, or by nothing if the variable is not defined. To avoid variable replacement, $ has to be escaped.
The default PUMA configuration file location is /etc/puma.config. It can be overwritten by setting the environment variable PUMA_CONFIG like this:
Use class Puma::Config to load the configuration in the correct order from the command line or a configuration file.