#ifndef FT_SSL_CMD_GLOBAL_H #define FT_SSL_CMD_GLOBAL_H #include #include #include "internal/cli/cli_handlers.h" #define GLOBAL_OPTION_LIST \ X( \ 'h', \ "help", \ no_argument, \ cli_handle_help, \ OPT_ARG_NONE, \ "Display this help and exit", \ 0 \ ) \ X( \ 'v', \ "version", \ no_argument, \ cli_handle_version, \ OPT_ARG_NONE, \ "Display version information and exit", \ 0 \ ) #undef X #define X(short_opt, long_opt, has_arg, handler, arg_type, desc, flags) + 1 enum { GLOBAL_OPT_LEN = (0 GLOBAL_OPTION_LIST) }; #undef X #define X(short_opt, long_opt, has_arg, handler, arg_type, desc, flags) \ + (1 * (has_arg == no_argument) \ + (2 * (has_arg == required_argument) \ + (3 * (has_arg == optional_argument)))) enum { GLOBAL_OPTSTR_LEN = (2 GLOBAL_OPTION_LIST) }; /* +2 for ':' to disable getopt error messages and \0 */ #undef X extern const struct option_descriptor g_global_opts[]; #endif