71 #ifndef INCLUDE_OLA_BASE_FLAGS_H_ 72 #define INCLUDE_OLA_BASE_FLAGS_H_ 87 const std::string &description);
121 #define DECLARE_bool(name) \ 122 DECLARE_flag(bool, name) 128 #define DECLARE_int8(name) \ 129 DECLARE_flag(int8_t, name) 135 #define DECLARE_int16(name) \ 136 DECLARE_flag(int16_t, name) 142 #define DECLARE_int32(name) \ 143 DECLARE_flag(int32_t, name) 149 #define DECLARE_uint8(name) \ 150 DECLARE_flag(uint8_t, name) 156 #define DECLARE_uint16(name) \ 157 DECLARE_flag(uint16_t, name) 163 #define DECLARE_uint32(name) \ 164 DECLARE_flag(uint32_t, name) 170 #define DECLARE_string(name) \ 171 DECLARE_flag(std::string, name) 189 #define DEFINE_bool(name, default_value, help_str) \ 190 DEFINE_flag(bool, name, \0, default_value, help_str, true) 207 #define DEFINE_s_bool(name, short_opt, default_value, help_str) \ 208 DEFINE_flag_with_short(bool, name, short_opt, default_value, help_str, true) 221 #define DEFINE_default_bool(name, default_value, help_str) \ 222 DEFINE_flag(bool, name, \0, default_value, help_str, false) 237 #define DEFINE_s_default_bool(name, short_opt, default_value, help_str) \ 238 DEFINE_flag_with_short(bool, name, short_opt, default_value, help_str, false) 247 #define DEFINE_int8(name, default_value, help_str) \ 248 DEFINE_flag(int8_t, name, \0, default_value, help_str, true) 258 #define DEFINE_s_int8(name, short_opt, default_value, help_str) \ 259 DEFINE_flag_with_short(int8_t, name, short_opt, default_value, help_str, \ 269 #define DEFINE_uint8(name, default_value, help_str) \ 270 DEFINE_flag(uint8_t, name, \0, default_value, help_str, true) 280 #define DEFINE_s_uint8(name, short_opt, default_value, help_str) \ 281 DEFINE_flag_with_short(uint8_t, name, short_opt, default_value, help_str, \ 291 #define DEFINE_int16(name, default_value, help_str) \ 292 DEFINE_flag(int16_t, name, \0, default_value, help_str, true) 302 #define DEFINE_s_int16(name, short_opt, default_value, help_str) \ 303 DEFINE_flag_with_short(int16_t, name, short_opt, default_value, help_str, \ 314 #define DEFINE_uint16(name, default_value, help_str) \ 315 DEFINE_flag(uint16_t, name, \0, default_value, help_str, true) 325 #define DEFINE_s_uint16(name, short_opt, default_value, help_str) \ 326 DEFINE_flag_with_short(uint16_t, name, short_opt, default_value, help_str, \ 336 #define DEFINE_int32(name, default_value, help_str) \ 337 DEFINE_flag(int32_t, name, \0, default_value, help_str, true) 347 #define DEFINE_s_int32(name, short_opt, default_value, help_str) \ 348 DEFINE_flag_with_short(int32_t, name, short_opt, default_value, help_str, \ 358 #define DEFINE_uint32(name, default_value, help_str) \ 359 DEFINE_flag(uint32_t, name, \0, default_value, help_str, true) 369 #define DEFINE_s_uint32(name, short_opt, default_value, help_str) \ 370 DEFINE_flag_with_short(uint32_t, name, short_opt, default_value, help_str, \ 380 #define DEFINE_string(name, default_value, help_str) \ 381 DEFINE_flag(std::string, name, \0, default_value, help_str, true) 391 #define DEFINE_s_string(name, short_opt, default_value, help_str) \ 392 DEFINE_flag_with_short(std::string, name, short_opt, default_value, \ 397 #endif // INCLUDE_OLA_BASE_FLAGS_H_ void ParseFlags(int *argc, char **argv)
Parses the command line flags up to the first non-flag value. argv is re-arranged so that it only con...
Definition: Flags.cpp:99
Internal functionality for the flags.
void DisplayUsage()
Print the usage text to stdout.
Definition: Flags.cpp:82
void DisplayVersion()
Print the version text to stdout.
Definition: Flags.cpp:91
void DisplayUsageAndExit()
Print the usage text to stdout then exit.
Definition: Flags.cpp:86
void SetHelpString(const string &first_line, const string &description)
Set the help string for the program.
Definition: Flags.cpp:77
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44