62
65
const char *string_parser_help; /**< @brief generate a string parser (the string contains the command line) help description. */
63
66
const char *include_getopt_help; /**< @brief adds the code for getopt_long in the generated C file help description. */
64
67
const char *no_handle_help_help; /**< @brief do not handle --help|-h automatically help description. */
68
const char *no_help_help; /**< @brief do not add --help|-h automatically help description. */
65
69
const char *no_handle_version_help; /**< @brief do not handle --version|-V automatically help description. */
70
const char *no_version_help; /**< @brief do not add --version|-V automatically help description. */
66
71
const char *no_handle_error_help; /**< @brief do not exit on errors help description. */
67
72
char * show_required_arg; /**< @brief in the output of help will specify which options are mandatory, by using the optional passed string (default='(mandatory)'). */
68
73
char * show_required_orig; /**< @brief in the output of help will specify which options are mandatory, by using the optional passed string original value given at command line. */
76
81
char * set_version_orig; /**< @brief set the version number (override version defined in the .ggo file) original value given at command line. */
77
82
const char *set_version_help; /**< @brief set the version number (override version defined in the .ggo file) help description. */
78
83
const char *show_help_help; /**< @brief show the output of --help instead of generating code help description. */
79
const char *show_full_help_help; /**< @brief show the output of --help (including hidden options) instead of generating code help description. */
84
const char *show_full_help_help; /**< @brief show the output of --full-help (i.e., including hidden options) instead of generating code help description. */
85
const char *show_detailed_help_help; /**< @brief show the output of --detailed-help (i.e., including details and hidden options) instead of generating code help description. */
80
86
const char *show_version_help; /**< @brief show the output of --version instead of generating code help description. */
82
int help_given ; /**< @brief Whether help was given. */
83
int version_given ; /**< @brief Whether version was given. */
84
int input_given ; /**< @brief Whether input was given. */
85
int func_name_given ; /**< @brief Whether func-name was given. */
86
int arg_struct_name_given ; /**< @brief Whether arg-struct-name was given. */
87
int file_name_given ; /**< @brief Whether file-name was given. */
88
int output_dir_given ; /**< @brief Whether output-dir was given. */
89
int c_extension_given ; /**< @brief Whether c-extension was given. */
90
int header_extension_given ; /**< @brief Whether header-extension was given. */
91
int long_help_given ; /**< @brief Whether long-help was given. */
92
int default_optional_given ; /**< @brief Whether default-optional was given. */
93
int unamed_opts_given ; /**< @brief Whether unamed-opts was given. */
94
int conf_parser_given ; /**< @brief Whether conf-parser was given. */
95
int string_parser_given ; /**< @brief Whether string-parser was given. */
96
int include_getopt_given ; /**< @brief Whether include-getopt was given. */
97
int no_handle_help_given ; /**< @brief Whether no-handle-help was given. */
98
int no_handle_version_given ; /**< @brief Whether no-handle-version was given. */
99
int no_handle_error_given ; /**< @brief Whether no-handle-error was given. */
100
int show_required_given ; /**< @brief Whether show-required was given. */
101
int gen_version_given ; /**< @brief Whether gen-version was given. */
102
int set_package_given ; /**< @brief Whether set-package was given. */
103
int set_version_given ; /**< @brief Whether set-version was given. */
104
int show_help_given ; /**< @brief Whether show-help was given. */
105
int show_full_help_given ; /**< @brief Whether show-full-help was given. */
106
int show_version_given ; /**< @brief Whether show-version was given. */
88
unsigned int help_given ; /**< @brief Whether help was given. */
89
unsigned int detailed_help_given ; /**< @brief Whether detailed-help was given. */
90
unsigned int version_given ; /**< @brief Whether version was given. */
91
unsigned int input_given ; /**< @brief Whether input was given. */
92
unsigned int func_name_given ; /**< @brief Whether func-name was given. */
93
unsigned int arg_struct_name_given ; /**< @brief Whether arg-struct-name was given. */
94
unsigned int file_name_given ; /**< @brief Whether file-name was given. */
95
unsigned int output_dir_given ; /**< @brief Whether output-dir was given. */
96
unsigned int c_extension_given ; /**< @brief Whether c-extension was given. */
97
unsigned int header_extension_given ; /**< @brief Whether header-extension was given. */
98
unsigned int long_help_given ; /**< @brief Whether long-help was given. */
99
unsigned int default_optional_given ; /**< @brief Whether default-optional was given. */
100
unsigned int unamed_opts_given ; /**< @brief Whether unamed-opts was given. */
101
unsigned int conf_parser_given ; /**< @brief Whether conf-parser was given. */
102
unsigned int string_parser_given ; /**< @brief Whether string-parser was given. */
103
unsigned int include_getopt_given ; /**< @brief Whether include-getopt was given. */
104
unsigned int no_handle_help_given ; /**< @brief Whether no-handle-help was given. */
105
unsigned int no_help_given ; /**< @brief Whether no-help was given. */
106
unsigned int no_handle_version_given ; /**< @brief Whether no-handle-version was given. */
107
unsigned int no_version_given ; /**< @brief Whether no-version was given. */
108
unsigned int no_handle_error_given ; /**< @brief Whether no-handle-error was given. */
109
unsigned int show_required_given ; /**< @brief Whether show-required was given. */
110
unsigned int gen_version_given ; /**< @brief Whether gen-version was given. */
111
unsigned int set_package_given ; /**< @brief Whether set-package was given. */
112
unsigned int set_version_given ; /**< @brief Whether set-version was given. */
113
unsigned int show_help_given ; /**< @brief Whether show-help was given. */
114
unsigned int show_full_help_given ; /**< @brief Whether show-full-help was given. */
115
unsigned int show_detailed_help_given ; /**< @brief Whether show-detailed-help was given. */
116
unsigned int show_version_given ; /**< @brief Whether show-version was given. */
161
174
struct cmdline_parser_params *params);
177
* Save the contents of the option struct into an already open FILE stream.
178
* @param outfile the stream where to dump options
179
* @param args_info the option struct to dump
180
* @return 0 if everything went fine, NON 0 if an error took place
182
int cmdline_parser_dump(FILE *outfile,
183
struct gengetopt_args_info *args_info);
164
186
* Save the contents of the option struct into a (text) file.
165
187
* This file can be read by the config file parser (if generated by gengetopt)
166
188
* @param filename the file where to save
176
198
void cmdline_parser_print_help(void);
200
* Print the detailed help (including hidden options and details)
202
void cmdline_parser_print_detailed_help(void);
178
204
* Print the version
180
206
void cmdline_parser_print_version(void);
209
* Initializes all the fields a cmdline_parser_params structure
210
* to their default values
211
* @param params the structure to initialize
213
void cmdline_parser_params_init(struct cmdline_parser_params *params);
183
216
* Allocates dynamically a cmdline_parser_params structure and initializes
184
* all its fields to 0
185
* @return the initialized cmdline_parser_params structure
217
* all its fields to their default values
218
* @return the created and initialized cmdline_parser_params structure
187
struct cmdline_parser_params *cmdline_parser_params_init();
220
struct cmdline_parser_params *cmdline_parser_params_create(void);
190
223
* Initializes the passed gengetopt_args_info structure's fields