goptions
Loading...
Searching...
No Matches
goptionsConventions.h File Reference

Conventions, constants, and error codes for the GOptions : / GOption : subsystem. More...

#include <string>
Include dependency graph for goptionsConventions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  goptions
 

Macros

#define HELPFILLSPACE   " "
 Padding used when printing option/switch help.
 
#define GVERSION_STRING   "version"
 Reserved option tag used to store version information.
 
Option parsing exit codes

Process exit codes used by GOptions : and GOption : .

These codes are used in exit(code) calls to allow scripts/tests to distinguish failure modes. They are part of the user-facing contract because they often appear in CI logs and batch workflows.

#define EC__NOOPTIONFOUND   101
 Option/switch/key not found, or invalid command-line token.
 
#define EC__DEFINED_OPTION_ALREADY_PRESENT   102
 Attempted to define an option name more than once.
 
#define EC__DEFINED_SWITCHALREADYPRESENT   103
 Attempted to define a switch name more than once.
 
#define EC__YAML_PARSING_ERROR   104
 YAML file failed to parse (syntax error or parser failure).
 
#define EC__MANDATORY_NOT_FILLED   105
 Mandatory structured option key (NODFLT) missing.
 
#define EC__BAD_CONVERSION   106
 YAML value could not be converted to requested type.
 
#define EC_WRONG_VERBOSITY_LEVEL   107
 Verbosity/debug values outside accepted range (if enforced).
 

Variables

const std::string goptions::NODFLT = "NODFLT"
 Marker literal indicating "no default value" for a structured option key.
 

Detailed Description

This header collects:

  • formatting constants for help output,
  • the reserved option name used to persist version metadata,
  • exit codes used by option parsing and validation,
  • and the goptions::NODFLT : marker that flags mandatory keys in structured options.
Note
When writing documentation, if you need to mention the Doxygen command literally, use \\ref (double backslash) so it prints as text rather than being parsed.

Definition in file goptionsConventions.h.

Macro Definition Documentation

◆ EC__BAD_CONVERSION

#define EC__BAD_CONVERSION   106

Definition at line 62 of file goptionsConventions.h.

◆ EC__DEFINED_OPTION_ALREADY_PRESENT

#define EC__DEFINED_OPTION_ALREADY_PRESENT   102

Definition at line 58 of file goptionsConventions.h.

◆ EC__DEFINED_SWITCHALREADYPRESENT

#define EC__DEFINED_SWITCHALREADYPRESENT   103

Definition at line 59 of file goptionsConventions.h.

◆ EC__MANDATORY_NOT_FILLED

#define EC__MANDATORY_NOT_FILLED   105

Definition at line 61 of file goptionsConventions.h.

◆ EC__NOOPTIONFOUND

#define EC__NOOPTIONFOUND   101

Definition at line 57 of file goptionsConventions.h.

◆ EC__YAML_PARSING_ERROR

#define EC__YAML_PARSING_ERROR   104

Definition at line 60 of file goptionsConventions.h.

◆ EC_WRONG_VERBOSITY_LEVEL

#define EC_WRONG_VERBOSITY_LEVEL   107

Definition at line 63 of file goptionsConventions.h.

◆ GVERSION_STRING

#define GVERSION_STRING   "version"

GOptions : registers this as a structured option so version metadata can be written to the saved YAML. It is not intended to be set by users. The saved YAML contains release metadata to support reproducibility in scripts and batch pipelines.

Definition at line 45 of file goptionsConventions.h.

◆ HELPFILLSPACE

#define HELPFILLSPACE   " "

This string controls the width of the left column used by the help output produced by GOptions : and GOption : so the console formatting stays aligned.

Typical usage pattern:

  • Build the left-hand label (e.g. -runno=<value>).
  • Print it in a fixed-width field using this padding.
  • Print the human-readable description after the aligned column.
Note
The formatting routines live in internal implementation methods; documentation avoids cross-referencing private symbols to prevent unresolved references when private extraction is disabled.

Definition at line 35 of file goptionsConventions.h.