Home | History | Annotate | Download | only in lib

Lines Matching defs:options

11 //   Integrated --long options "(noshort)a(along)b(blong1)(blong2)"
20 * Options which have an argument fill in the corresponding slot in the global
28 * Calling get_optflags() when toys.which->options="ab:c:d" and
72 // At the beginning of the get_opt string (before any options):
80 // At the end: [groups] of previously seen options
92 // Linked list of all known options (option string parsed into this).
107 // linked list of long options. (Hangs off getoptflagstate, free at end of
225 // Parse this command's options string into struct getoptflagstate, which
229 char *options = toys.which->options;
237 if (!options) return;
241 if (*options == '^') gof->stopearly++;
242 else if (*options == '<') gof->minargs=*(++options)-'0';
243 else if (*options == '>') gof->maxargs=*(++options)-'0';
244 else if (*options == '?') gof->noerror++;
245 else if (*options == '&') gof->nodash++;
247 options++;
250 // Parse option string into a linked list of options with attributes.
252 if (!*options) gof->stopearly++;
253 while (*options) {
256 // Option groups come after all options are defined
257 if (*options == '[') break;
269 if (*options == '(' && new->c != -1) {
274 for (end = ++options; *end && *end != ')'; end++);
281 lo->str = options;
282 lo->len = end-options;
284 options = ++end;
293 } else if (strchr(":*#@.-", *options)) {
295 error_exit("multiple types %c:%c%c", new->c, new->type, *options);
296 new->type = *options;
297 } else if (-1 != (idx = stridx("|^ ;", *options))) new->flags |= 1<<idx;
299 else if (-1 != (idx = stridx("<>=", *options))) {
301 long l = strtol(++options, &temp, 10);
302 if (temp != options) new->val[idx].l = l;
304 FLOAT f = strtod(++options, &temp);
305 if (temp != options) new->val[idx].f = f;
307 options = --temp;
318 } else new->c = *options;
320 options++;
339 while (*options) {
342 if (CFG_TOYBOX_DEBUG && *options != '[') error_exit("trailing %s", options);
344 idx = stridx("-+!", *++options);
346 if (CFG_TOYBOX_DEBUG && (options[1] == ']' || !options[1]))
350 while (*options++ != ']') {
354 if (CFG_TOYBOX_DEBUG && !*options) error_exit("[ without ]");
357 if (*options == ']') {
362 error_exit("[] unknown target %c", *options);
363 if (opt->c == *options) {