- if (opt_table[i].shortopt && opt_table[i].longopt)
- len = sprintf(p, "--%s/-%c",
- opt_table[i].longopt,
- opt_table[i].shortopt);
- else if (opt_table[i].shortopt)
- len = sprintf(p, "-%c", opt_table[i].shortopt);
- else
- len = sprintf(p, "--%s", opt_table[i].longopt);
- if (opt_table[i].flags == OPT_HASARG)
+ len = sprintf(p, "%s", opt_table[i].names);
+ if (opt_table[i].type == OPT_HASARG
+ && !strchr(opt_table[i].names, ' ')
+ && !strchr(opt_table[i].names, '='))