Home | History | Annotate | Download | only in lib

Lines Matching refs:opt

69 //     ; long option's argument is optional (can only be supplied with --opt=)
111 // stored in related short option struct, but if opt->c = -1 the long option
115 struct opts *opt;
132 static int gotflag(struct getoptflagstate *gof, struct opts *opt)
137 if (!opt) {
143 if (toys.optflags & opt->dex[0]) {
149 if (clr->arg && (i & toys.optflags & opt->dex[0])) *clr->arg = 0;
150 toys.optflags &= ~opt->dex[0];
154 toys.optflags |= opt->dex[1];
155 gof->excludes |= opt->dex[2];
156 if (opt->flags&2) gof->stopearly=2;
163 if (opt == bad || !(i & toys.optflags)) continue;
166 if (bad) help_exit("No '%c' with '%c'", opt->c, bad->c);
171 if (opt->flags & 8) return 0;
174 type = opt->type;
176 if (type == '@') ++*(opt->arg);
184 if (gof->nodash_now || (!arg[0] && !(opt->flags & 8)))
190 if (opt->c != -1) help_exit("%s-%c", s, opt->c);
192 for (lo = gof->longopts; lo->opt != opt; lo = lo->next);
196 if (type == ':') *(opt->arg) = (long)arg;
200 list = (struct arg_list **)opt->arg;
207 if (l < opt->val[0].l) help_exit("-%c < %ld", opt->c, opt->val[0].l);
208 if (l > opt->val[1].l) help_exit("-%c > %ld", opt->c, opt->val[1].l);
210 *(opt->arg) = l;
212 FLOAT *f = (FLOAT *)(opt->arg);
215 if (opt->val[0].l != LONG_MIN && *f < opt->val[0].f)
216 help_exit("-%c < %lf", opt->c, (double)opt->val[0].f);
217 if (opt->val[1].l != LONG_MAX && *f > opt->val[1].f)
218 help_exit("-%c > %lf", opt->c, (double)opt->val[1].f);
282 lo->opt = new;
288 // Mark this struct opt as used, even when no short opt.
353 struct opts *opt;
357 // Find this option flag (in previously parsed struct opt)
358 for (i=0, opt = gof->opts; ; i++, opt = opt->next) {
360 if (!opt) break;
361 if (bits&(1<<i)) opt->dex[idx] |= bits&~(1<<i);
364 if (CFG_TOYBOX_DEBUG && !opt)
366 if (opt->c == *options) {
425 else if (gof.arg[lo->len] == '=' && lo->opt->type)
429 catch = lo->opt;