Lines Matching refs:opt

41   auto struct grub_arg_option *fnd_short (const struct grub_arg_option *opt);
43 struct grub_arg_option *fnd_short (const struct grub_arg_option *opt)
45 while (opt->doc)
47 if (opt->shortarg == c)
48 return (struct grub_arg_option *) opt;
49 opt++;
81 auto struct grub_arg_option *fnd_long (const struct grub_arg_option *opt);
83 struct grub_arg_option *fnd_long (const struct grub_arg_option *opt)
85 while (opt->doc)
87 if (opt->longarg && ! grub_strncmp (opt->longarg, s, len) &&
88 opt->longarg[len] == '\0')
89 return (struct grub_arg_option *) opt;
90 opt++;
113 auto void showargs (const struct grub_arg_option *opt);
117 auto void showargs (const struct grub_arg_option *opt)
119 for (; opt->doc; opt++)
123 if (opt->shortarg && grub_isgraph (opt->shortarg))
124 grub_printf ("-%c%c ", opt->shortarg, opt->longarg ? ',':' ');
125 else if (opt == help_options && ! h_is_used)
127 else if (opt == help_options + 1 && ! u_is_used)
132 if (opt->longarg)
134 grub_printf ("--%s", opt->longarg);
135 spacing -= grub_strlen (opt->longarg) + 2;
137 if (opt->arg)
139 grub_printf ("=%s", opt->arg);
140 spacing -= grub_strlen (opt->arg) + 1;
150 grub_printf ("%s\n", _(opt->doc));
152 switch (opt->shortarg)
180 parse_option (grub_extcmd_t cmd, const struct grub_arg_option *opt,
183 if (opt == help_options)
189 if (opt == help_options + 1)
195 int found = opt - cmd->options;
197 if (opt->flags & GRUB_ARG_OPTION_REPEATABLE)
240 struct grub_arg_option *opt;
276 opt = find_short (cmd->options, *curshort);
278 if (! opt)
291 if (parse_option (cmd, opt, 0, usr) || grub_errno)
296 if (opt->type != ARG_TYPE_NONE)
301 if (!(opt->flags & GRUB_ARG_OPTION_OPTIONAL)
332 opt = find_long (cmd->options, arg + 2, arglen);
335 && opt && opt->type != ARG_TYPE_NONE)
338 if (!opt && (cmd->cmd->flags & GRUB_COMMAND_ACCEPT_DASH))
345 if (! opt)
352 if (! (opt->type == ARG_TYPE_NONE
353 || (! option && (opt->flags & GRUB_ARG_OPTION_OPTIONAL))))
358 "missing mandatory option for `%s'", opt->longarg);
362 switch (opt->type)
395 if (parse_option (cmd, opt, option, usr) || grub_errno)
408 if (parse_option (cmd, opt, 0, usr) || grub_errno)