![]() |
advgetopt 2.0.49
Parse complex command line arguments and configuration files in C++.
|
Functions | |
void | check_for_show_sources (int argc, char *argv[]) |
Check for a "--show-option-sources" flag. | |
bool | is_arg (char const *a) |
Check whether this parameter is an argument. | |
Variables | |
option const | g_if_configuration_filename_system_options [] |
Optional list of options. | |
option const | g_system_options [] |
Definitions of the system options. | |
void advgetopt::anonymous_namespace{advgetopt.cpp}::check_for_show_sources | ( | int | argc, |
char * | argv[] | ||
) |
When this flag is defined, we turn on the trace mode in the option_info class (which is a global flag). That way we can honor the "--show-option-sources" when we are done parsing the configuration files, environment variable, and command line.
[in] | argc | The number of items in the argv array. |
[in] | argv | The arguments. |
Definition at line 347 of file advgetopt.cpp.
References check_for_show_sources(), and advgetopt::option_info::set_trace_sources().
Referenced by check_for_show_sources().
bool advgetopt::anonymous_namespace{advgetopt.cpp}::is_arg | ( | char const * | a | ) |
An argument is defined as a command line parameter that starts with a dash and is not just "-".
Note that "--" is viewed as an argument (this function returns true) and the getopt class takes it as a command meaning any other parameter is not an argument.
Definition at line 328 of file advgetopt.cpp.
References is_arg().
Referenced by is_arg().
option const advgetopt::anonymous_namespace{advgetopt.cpp}::g_if_configuration_filename_system_options[] |
This optional list of options is added only when the f_configuration_filename parameter has a valid filename.
The following are the currently added options:
--config-dir
This option allows for adding more configuration directories. These work the same way as directories defined in the f_configuration_directories.
Definition at line 302 of file advgetopt.cpp.
option const advgetopt::anonymous_namespace{advgetopt.cpp}::g_system_options[] |
The system options are options we add automatically (if the user asked for them) and handle automatically when they are found.
The following are the currently supported system options:
--help
Print out the usage() with most of the command line arguments.
Print all the command line arguments with usage().
The long help is is only added if the list of options include at least one group flag (GETOPT_FLAG_SHOW_GROUP1 or GETOPT_FLAG_SHOW_GROUP2). See the getopt::parse_options_from_group_names() in advgetopt_usage.cpp.
Print the help from the group named <name>.
These command line options are added only when groups are defined.
--version
Print out the version.
--copyright
Print out the copyright notice.
--license
Print out the license notice.
--build-date
Print out the build time and date.
--environment-variable-name
Print out the build time and date.
--configuration-filenames
Print out the list of configuration file names that the system checks for configuration data.
--path-to-option-definitions
Print out the path to files which define options for this tool.
--source-option-sources
Print out all the options and their sources. This shows you where a value come from: command line, environment variable, configuration file, etc.
--config
option to allow the user to name one specific configuration file to use with an executable. Definition at line 197 of file advgetopt.cpp.
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.