Lines Matching refs:arg

19 		   int flags, const char **arg)  in get_arg()  argument
22 *arg = p->opt; in get_arg()
26 *arg = (const char *)opt->defval; in get_arg()
29 *arg = *++p->argv; in get_arg()
38 const char *s, *arg = NULL; in get_value() local
149 if (get_arg(p, opt, flags, &arg)) in get_value()
151 return (*opt->callback)(opt, arg, 0) ? (-1) : 0; in get_value()
162 if (get_arg(p, opt, flags, &arg)) in get_value()
164 *(int *)opt->value = strtol(arg, (char **)&s, 10); in get_value()
178 if (get_arg(p, opt, flags, &arg)) in get_value()
180 *(unsigned int *)opt->value = strtol(arg, (char **)&s, 10); in get_value()
194 if (get_arg(p, opt, flags, &arg)) in get_value()
196 *(long *)opt->value = strtol(arg, (char **)&s, 10); in get_value()
210 if (get_arg(p, opt, flags, &arg)) in get_value()
212 *(u64 *)opt->value = strtoull(arg, (char **)&s, 10); in get_value()
236 static int parse_long_opt(struct parse_opt_ctx_t *p, const char *arg, in parse_long_opt() argument
239 const char *arg_end = strchr(arg, '='); in parse_long_opt()
244 arg_end = arg + strlen(arg); in parse_long_opt()
253 rest = skip_prefix(arg, options->long_name); in parse_long_opt()
261 p->out[p->cpidx++] = arg - 2; in parse_long_opt()
272 rest = skip_prefix(arg, options->long_name + 3); in parse_long_opt()
278 if (!prefixcmp(options->long_name + 3, arg)) { in parse_long_opt()
284 if (!strncmp(options->long_name, arg, arg_end - arg)) { in parse_long_opt()
303 if (!prefixcmp("no-", arg)) { in parse_long_opt()
308 if (strncmp(arg, "no-", 3)) in parse_long_opt()
311 rest = skip_prefix(arg + 3, options->long_name); in parse_long_opt()
313 if (!rest && !prefixcmp(options->long_name, arg + 3)) in parse_long_opt()
330 arg, in parse_long_opt()
340 static void check_typos(const char *arg, const struct option *options) in check_typos() argument
342 if (strlen(arg) < 3) in check_typos()
345 if (!prefixcmp(arg, "no-")) { in check_typos()
346 error ("did you mean `--%s` (with two dashes ?)", arg); in check_typos()
353 if (!prefixcmp(options->long_name, arg)) { in check_typos()
354 error ("did you mean `--%s` (with two dashes ?)", arg); in check_typos()
383 const char *arg; in parse_options_step() local
389 arg = ctx->argv[0]; in parse_options_step()
390 if (*arg != '-' || !arg[1]) { in parse_options_step()
397 if (arg[1] != '-') { in parse_options_step()
398 ctx->opt = ++arg; in parse_options_step()
403 return parse_options_usage(usagestr, options, arg, 1); in parse_options_step()
412 check_typos(arg, options); in parse_options_step()
416 arg = ctx->opt; in parse_options_step()
419 return parse_options_usage(usagestr, options, arg, 1); in parse_options_step()
438 if (!arg[2]) { /* "--" */ in parse_options_step()
446 arg += 2; in parse_options_step()
447 if (internal_help && !strcmp(arg, "help-all")) in parse_options_step()
449 if (internal_help && !strcmp(arg, "help")) in parse_options_step()
451 if (!strcmp(arg, "list-opts")) in parse_options_step()
453 if (!strcmp(arg, "list-cmds")) in parse_options_step()
455 switch (parse_long_opt(ctx, arg, options)) { in parse_options_step()
457 return parse_options_usage(usagestr, options, arg, 0); in parse_options_step()
476 parse_options_usage(usagestr, options, arg, excl_short_opt); in parse_options_step()
724 const char *arg __maybe_unused, in parse_opt_verbosity_cb()