Lines Matching defs:options
15 // Integrated --long options "(noshort)a(along)b(blong1)(blong2)"
32 * Calling get_optflags() when toys.which->options="ab:c:d" and
73 // At the beginning of the get_opt string (before any options):
80 // At the end: [groups] of previously seen options
95 // Linked list of all known options (option string parsed into this).
110 // linked list of long options. (Hangs off getoptflagstate, free at end of
228 // Parse this command's options string into struct getoptflagstate, which
232 char *options = toys.which->options;
240 if (!options) return;
244 if (*options == '^') gof->stopearly++;
245 else if (*options == '<') gof->minargs=*(++options)-'0';
246 else if (*options == '>') gof->maxargs=*(++options)-'0';
247 else if (*options == '?') gof->noerror++;
248 else if (*options == '&') gof->nodash_now = 1;
250 options++;
253 // Parse option string into a linked list of options with attributes.
255 if (!*options) gof->stopearly++;
256 while (*options) {
259 // Option groups come after all options are defined
260 if (*options == '[') break;
272 if (*options == '(' && new->c != -1) {
277 for (end = ++options; *end && *end != ')'; end++);
284 lo->str = options;
285 lo->len = end-options;
287 options = ++end;
296 } else if (strchr(":*#@.-%", *options)) {
298 error_exit("multiple types %c:%c%c", new->c, new->type, *options);
299 new->type = *options;
300 } else if (-1 != (idx = stridx("|^ ;", *options))) new->flags |= 1<<idx;
302 else if (-1 != (idx = stridx("<>=", *options))) {
304 long l = strtol(++options, &temp, 10);
305 if (temp != options) new->val[idx].l = l;
307 FLOAT f = strtod(++options, &temp);
308 if (temp != options) new->val[idx].f = f;
310 options = --temp;
321 } else new->c = 127&*options;
323 options++;
342 while (*options) {
345 if (CFG_TOYBOX_DEBUG && *options != '[') error_exit("trailing %s", options);
347 idx = stridx("-+!", *++options);
349 if (CFG_TOYBOX_DEBUG && (options[1] == ']' || !options[1]))
353 while (*options++ != ']') {
357 if (CFG_TOYBOX_DEBUG && !*options) error_exit("[ without ]");
360 if (*options == ']') {
364 if (*options==1) break;
366 error_exit("[] unknown target %c", *options);
367 if (opt->c == *options) {