master - cmdline: add arg_long_option_name
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b57b394ebbb4b4078d532318110cff60e38035d3 Commit: b57b394ebbb4b4078d532318110cff60e38035d3 Parent: 2edf488b3844a067bcdfe8f8efdf1a086c52a5cf Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Mar 22 20:20:33 2013 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Apr 2 15:16:53 2013 +0200
cmdline: add arg_long_option_name
Add simple function to return long_name string option for given arg.
--- tools/lvmcmdline.c | 5 +++++ tools/tools.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-)
tools/lvmcmdline.c +5 -0
@@ -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;
tools/tools.h +1 -0
@@ -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);