1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

cmdline: add arg_long_option_name

Add simple function to return long_name string option for given arg.
This commit is contained in:
Zdenek Kabelac 2013-03-22 20:20:33 +01:00
parent 2edf488b38
commit b57b394ebb
2 changed files with 6 additions and 0 deletions

View File

@ -73,6 +73,11 @@ unsigned grouped_arg_is_set(const struct arg_values *av, int a)
return grouped_arg_count(av, a) ? 1 : 0;
}
const char *arg_long_option_name(int a)
{
return _cmdline.arg_props[a].long_arg;
}
const char *arg_value(struct cmd_context *cmd, int a)
{
return cmd->arg_values[a].value;

View File

@ -163,6 +163,7 @@ int major_minor_valid(const struct cmd_context * cmd, const struct format_type *
/* we use the enums to access the switches */
unsigned arg_count(const struct cmd_context *cmd, int a);
unsigned arg_is_set(const struct cmd_context *cmd, int a);
const char *arg_long_option_name(int a);
const char *arg_value(struct cmd_context *cmd, int a);
const char *arg_str_value(struct cmd_context *cmd, int a, const char *def);
int32_t arg_int_value(struct cmd_context *cmd, int a, const int32_t def);