Lines Matching refs:arg

19 		   int flags, const char **arg)
22 *arg = p->opt;
26 *arg = (const char *)opt->defval;
29 *arg = *++p->argv;
38 const char *s, *arg = NULL;
111 if (get_arg(p, opt, flags, &arg))
113 return (*opt->callback)(opt, arg, 0) ? (-1) : 0;
124 if (get_arg(p, opt, flags, &arg))
126 *(int *)opt->value = strtol(arg, (char **)&s, 10);
140 if (get_arg(p, opt, flags, &arg))
142 *(unsigned int *)opt->value = strtol(arg, (char **)&s, 10);
156 if (get_arg(p, opt, flags, &arg))
158 *(long *)opt->value = strtol(arg, (char **)&s, 10);
172 if (get_arg(p, opt, flags, &arg))
174 *(u64 *)opt->value = strtoull(arg, (char **)&s, 10);
198 static int parse_long_opt(struct parse_opt_ctx_t *p, const char *arg,
201 const char *arg_end = strchr(arg, '=');
206 arg_end = arg + strlen(arg);
215 rest = skip_prefix(arg, options->long_name);
223 p->out[p->cpidx++] = arg - 2;
228 if (!strncmp(options->long_name, arg, arg_end - arg)) {
247 if (!prefixcmp("no-", arg)) {
252 if (strncmp(arg, "no-", 3))
255 rest = skip_prefix(arg + 3, options->long_name);
257 if (!rest && !prefixcmp(options->long_name, arg + 3))
273 arg,
283 static void check_typos(const char *arg, const struct option *options)
285 if (strlen(arg) < 3)
288 if (!prefixcmp(arg, "no-")) {
289 error ("did you mean `--%s` (with two dashes ?)", arg);
296 if (!prefixcmp(options->long_name, arg)) {
297 error ("did you mean `--%s` (with two dashes ?)", arg);
330 const char *arg = ctx->argv[0];
332 if (*arg != '-' || !arg[1]) {
339 if (arg[1] != '-') {
340 ctx->opt = arg + 1;
352 check_typos(arg + 1, options);
375 if (!arg[2]) { /* "--" */
383 if (internal_help && !strcmp(arg + 2, "help-all"))
385 if (internal_help && !strcmp(arg + 2, "help"))
387 if (!strcmp(arg + 2, "list-opts"))
389 switch (parse_long_opt(ctx, arg + 2, options)) {
569 const char *arg __maybe_unused,