Closed ci70 closed 4 years ago
How to parse / options on windows with ketopt.h?
int opt = -1, i0, j; if (permute) { while ( s->i < argc && ( ( argv[s->i][0] != '-') || ( argv[s->i][0] != '/') ) || argv[s->i][1] == '\0') ) ++s->i, ++s->n_args; } s->arg = 0, s->longidx = -1, i0 = s->i; if ( s->i >= argc || ( ( argv[s->i][0] != '-' ) || (argv[s->i][0] != '/') ) || argv[s->i][1] == '\0' ) { s->ind = s->i - s->n_args; return -1; } if ( (argv[s->i][0] == '-' && argv[s->i][1] == '-') || (argv[s->i][0] == '/') ) { /* "--" or a long option */ if (argv[s->i][2] == '\0') { /* a bare "--" */ ketopt_permute(argv, s->i, s->n_args); ++s->i, s->ind = s->i - s->n_args; return -1; }
kopt only support unix-style options, not options starting with "/".
How to parse / options on windows with ketopt.h?