float opt_value_float;
while ((c = optparse_long(&optparse_state, longopts, NULL)) != EOF) {
switch (c) {
+ case '0':
+ /*
+ * Use long-option example
+ * Define "struct optparse_long longopts": { "long-option-name", '0', OPTPARSE_NONE }
+ *
+ * if(strstr(optparse_state.optlongname, "long-option-name") != NULL) {
+ * long_option_flag = 1;
+ * }
+ */
+ break;
case '4':
#ifdef IPV6
if (hints_ai_family != AF_UNSPEC && hints_ai_family != AF_INET) {
/* Parse as long option. */
options->errmsg[0] = '\0';
options->optopt = 0;
+ options->optlongname = 0;
options->optarg = 0;
option += 2; /* skip "--" */
options->optind++;
for (int i = 0; !longopts_end(longopts, i); i++) {
const char *name = longopts[i].longname;
if (longopts_match(name, option)) {
+ options->optlongname = option;
if (longindex)
*longindex = i;
options->optopt = longopts[i].shortname;