diff --git a/tools/command-lines.in b/tools/command-lines.in index 5697ba2ce..0ee778274 100644 --- a/tools/command-lines.in +++ b/tools/command-lines.in @@ -209,14 +209,14 @@ OO_ALL: --commandprofile String, --config String, --debug, # # options for pvdisplay, lvdisplay, vgdisplay # -OO_REPORTING: --all, --configreport ConfigReport, --foreign, +OO_REPORTING: --configreport ConfigReport, --foreign, --ignorelockingfailure, --logonly, --readonly, --reportformat ReportFmt, --select String, --shared, --units Units # # options for pvs, lvs, vgs, fullreport # -OO_REPORT: OO_REPORTING, --aligned, --binary, +OO_REPORT: OO_REPORTING, --all, --aligned, --binary, --headings HeadingsType, --nameprefixes, --noheadings, --nosuffix, --options String, --rows, --separator String, --sort String, --unbuffered, --unquoted @@ -1400,14 +1400,14 @@ ID: lvdisplay_columns DESC: Display output in columns like lvs. lvdisplay --colon -OO: OO_REPORTING, --history, --segments +OO: OO_REPORTING, --all, --history, --segments OP: VG|LV|Tag ... IO: --partial, --ignoreskippedcluster ID: lvdisplay_colon DESC: Generate colon separated output. lvdisplay -OO: OO_REPORTING, --history, --segments, --maps +OO: OO_REPORTING, --all, --history, --segments, --maps OP: VG|LV|Tag ... IO: --partial, --ignoreskippedcluster ID: lvdisplay_general @@ -1658,6 +1658,7 @@ OO: OO_REPORTING, --maps, --segments, --short OP: PV|Tag ... IO: --partial, --ignoreskippedcluster ID: pvdisplay_general +DESC: Display Physical Volumes. --- diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 2fe739c3f..05d19d9f8 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -95,7 +95,8 @@ static const struct command_function _command_functions[CMD_COUNT] = { /* pvdisplay variants */ { pvdisplay_columns_CMD, pvdisplay_columns_cmd }, - { pvdisplay_colon_CMD, pvdisplay_colon_cmd }, + { pvdisplay_colon_CMD, pvdisplay_cmd }, + { pvdisplay_general_CMD, pvdisplay_cmd }, /* vgdisplay variants */ { vgdisplay_columns_CMD, vgdisplay_columns_cmd }, diff --git a/tools/pvdisplay.c b/tools/pvdisplay.c index 8fb9ab4f3..f25b495f5 100644 --- a/tools/pvdisplay.c +++ b/tools/pvdisplay.c @@ -44,12 +44,10 @@ static int _pvdisplay_single(struct cmd_context *cmd, log_print_unless_silent("\"%s\" is a new physical volume of \"%s\"", pv_name, display_size(cmd, size)); - if (arg_is_set(cmd, colon_ARG)) { + if (arg_is_set(cmd, colon_ARG)) pvdisplay_colons(pv); - goto out; - } - - pvdisplay_full(cmd, pv, NULL); + else + pvdisplay_full(cmd, pv, NULL); if (arg_is_set(cmd, maps_ARG)) pvdisplay_segments(pv); @@ -58,41 +56,13 @@ out: return ret; } -int pvdisplay(struct cmd_context *cmd, int argc, char **argv) +int pvdisplay_cmd(struct cmd_context *cmd, int argc, char **argv) { - int ret; - - if (arg_is_set(cmd, columns_ARG)) { - if (arg_is_set(cmd, colon_ARG) || arg_is_set(cmd, maps_ARG) || - arg_is_set(cmd, short_ARG)) { - log_error("Incompatible options selected"); - return EINVALID_CMD_LINE; - } - return pvs(cmd, argc, argv); - } - - if (arg_is_set(cmd, aligned_ARG) || - arg_is_set(cmd, all_ARG) || - arg_is_set(cmd, binary_ARG) || - arg_is_set(cmd, noheadings_ARG) || - arg_is_set(cmd, options_ARG) || - arg_is_set(cmd, separator_ARG) || - arg_is_set(cmd, sort_ARG) || - arg_is_set(cmd, unbuffered_ARG)) { - log_error("Incompatible options selected"); - return EINVALID_CMD_LINE; - } - - if (arg_is_set(cmd, colon_ARG) && arg_is_set(cmd, maps_ARG)) { - log_error("Option -c not allowed with option -m"); - return EINVALID_CMD_LINE; - } - - if (arg_is_set(cmd, colon_ARG) && arg_is_set(cmd, short_ARG)) { - log_error("Option -c is not allowed with option -s"); - return EINVALID_CMD_LINE; - } + return process_each_pv(cmd, argc, argv, NULL, 0, 0, NULL, _pvdisplay_single); +} +int pvdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv) +{ /* * Without -a, command only looks at PVs and can use hints, * with -a, the command looks at all (non-hinted) devices. @@ -100,19 +70,12 @@ int pvdisplay(struct cmd_context *cmd, int argc, char **argv) if (arg_is_set(cmd, all_ARG)) cmd->use_hints = 0; - ret = process_each_pv(cmd, argc, argv, NULL, - arg_is_set(cmd, all_ARG), 0, - NULL, _pvdisplay_single); - - return ret; + return pvs(cmd, argc, argv); } -int pvdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv) +int pvdisplay(struct cmd_context *cmd, int argc, char **argv) { - return pvdisplay(cmd, argc, argv); -} - -int pvdisplay_colon_cmd(struct cmd_context *cmd, int argc, char **argv) -{ - return pvdisplay(cmd, argc, argv); + log_error(INTERNAL_ERROR "Missing function for command definition %d:%s.", + cmd->command->command_index, command_enum(cmd->command->command_enum)); + return ECMD_FAILED; } diff --git a/tools/tools.h b/tools/tools.h index ec8557996..6215fcd39 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -192,7 +192,7 @@ int lvdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv); int lvdisplay_colon_cmd(struct cmd_context *cmd, int argc, char **argv); int lvdisplay_general_cmd(struct cmd_context *cmd, int argc, char **argv); int pvdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv); -int pvdisplay_colon_cmd(struct cmd_context *cmd, int argc, char **argv); +int pvdisplay_cmd(struct cmd_context *cmd, int argc, char **argv); int vgdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv); int vgdisplay_colon_cmd(struct cmd_context *cmd, int argc, char **argv);