Lines Matching refs:opt
113 struct opts *opt; member
130 static int gotflag(struct getoptflagstate *gof, struct opts *opt) in gotflag() argument
135 if (!opt) { in gotflag()
141 if (toys.optflags & opt->dex[0]) { in gotflag()
147 if (clr->arg && (i & toys.optflags & opt->dex[0])) *clr->arg = 0; in gotflag()
148 toys.optflags &= ~opt->dex[0]; in gotflag()
152 toys.optflags |= opt->dex[1]; in gotflag()
153 gof->excludes |= opt->dex[2]; in gotflag()
154 if (opt->flags&2) gof->stopearly=2; in gotflag()
161 if (opt == bad || !(i & toys.optflags)) continue; in gotflag()
164 error_exit("No '%c' with '%c'", opt->c, bad->c); in gotflag()
169 if (opt->flags & 8) return 0; in gotflag()
172 type = opt->type; in gotflag()
174 if (type == '@') ++*(opt->arg); in gotflag()
182 if (gof->nodash_now || (!arg[0] && !(opt->flags & 8))) in gotflag()
188 if (opt->c != -1) error_exit("%s-%c", s, opt->c); in gotflag()
190 for (lo = gof->longopts; lo->opt != opt; lo = lo->next); in gotflag()
194 if (type == ':') *(opt->arg) = (long)arg; in gotflag()
198 list = (struct arg_list **)opt->arg; in gotflag()
205 if (l < opt->val[0].l) error_exit("-%c < %ld", opt->c, opt->val[0].l); in gotflag()
206 if (l > opt->val[1].l) error_exit("-%c > %ld", opt->c, opt->val[1].l); in gotflag()
208 *(opt->arg) = l; in gotflag()
210 FLOAT *f = (FLOAT *)(opt->arg); in gotflag()
213 if (opt->val[0].l != LONG_MIN && *f < opt->val[0].f) in gotflag()
214 error_exit("-%c < %lf", opt->c, (double)opt->val[0].f); in gotflag()
215 if (opt->val[1].l != LONG_MAX && *f > opt->val[1].f) in gotflag()
216 error_exit("-%c > %lf", opt->c, (double)opt->val[1].f); in gotflag()
280 lo->opt = new; in parse_optflaglist()
351 struct opts *opt; in parse_optflaglist() local
356 for (i=0, opt = gof->opts; ; i++, opt = opt->next) { in parse_optflaglist()
358 if (!opt) break; in parse_optflaglist()
359 if (bits&(1<<i)) opt->dex[idx] |= bits&~(1<<i); in parse_optflaglist()
361 if (CFG_TOYBOX_DEBUG && !opt) in parse_optflaglist()
363 if (opt->c == *options) { in parse_optflaglist()
423 else if (gof.arg[lo->len] == '=' && lo->opt->type) in get_optflags()
427 catch = lo->opt; in get_optflags()