Lines Matching defs:opt
68 // ; long option's argument is optional (can only be supplied with --opt=)
112 // stored in related short option struct, but if opt->c = -1 the long option
116 struct opts *opt;
133 static int gotflag(struct getoptflagstate *gof, struct opts *opt)
138 if (!opt) {
144 if (toys.optflags & opt->dex[0]) {
150 if (clr->arg && (i & toys.optflags & opt->dex[0])) *clr->arg = 0;
151 toys.optflags &= ~opt->dex[0];
155 toys.optflags |= opt->dex[1];
156 gof->excludes |= opt->dex[2];
157 if (opt->flags&2) gof->stopearly=2;
164 if (opt == bad || !(i & toys.optflags)) continue;
167 if (bad) help_exit("No '%c' with '%c'", opt->c, bad->c);
172 if (opt->flags & 8) return 0;
175 type = opt->type;
177 if (type == '@') ++*(opt->arg);
185 if (gof->nodash_now || (!arg[0] && !(opt->flags & 8)))
191 if (opt->c != -1) help_exit("%s-%c", s, opt->c);
193 for (lo = gof->longopts; lo->opt != opt; lo = lo->next);
197 if (type == ':') *(opt->arg) = (long)arg;
201 list = (struct arg_list **)opt->arg;
208 if (l < opt->val[0].l) help_exit("-%c < %ld", opt->c, opt->val[0].l);
209 if (l > opt->val[1].l) help_exit("-%c > %ld", opt->c, opt->val[1].l);
211 *(opt->arg) = l;
213 FLOAT *f = (FLOAT *)(opt->arg);
216 if (opt->val[0].l != LONG_MIN && *f < opt->val[0].f)
217 help_exit("-%c < %lf", opt->c, (double)opt->val[0].f);
218 if (opt->val[1].l != LONG_MAX && *f > opt->val[1].f)
219 help_exit("-%c > %lf", opt->c, (double)opt->val[1].f);
220 } else if (type=='%') *(opt->arg) = xparsemillitime(arg);
283 lo->opt = new;
289 // Mark this struct opt as used, even when no short opt.
354 struct opts *opt;
358 // Find this option flag (in previously parsed struct opt)
359 for (i=0, opt = gof->opts; ; i++, opt = opt->next) {
361 if (!opt) break;
362 if (bits&(1<<i)) opt->dex[idx] |= bits&~(1<<i);
365 if (CFG_TOYBOX_DEBUG && !opt)
367 if (opt->c == *options) {
430 else if (gof.arg[lo->len] == '=' && lo->opt->type)
434 catch = lo->opt;