From f08d1caf478936183946be1d7f5529338e8deb27 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Fri, 6 Dec 2024 09:18:23 -0600 Subject: [PATCH] vgdisplay: remove command def for activevolumegroups too minor to care about separating --- tools/command-lines.in | 11 ++--------- tools/lvmcmdline.c | 1 - tools/tools.h | 1 - tools/vgdisplay.c | 18 ++++++++++-------- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/tools/command-lines.in b/tools/command-lines.in index 3bd291600..dc65aff2f 100644 --- a/tools/command-lines.in +++ b/tools/command-lines.in @@ -1872,7 +1872,7 @@ ID: vgcreate_general --- vgdisplay -OO: OO_REPORTING, --short +OO: OO_REPORTING, --short, --activevolumegroups OP: VG|Tag ... IO: --partial, --ignoreskippedcluster ID: vgdisplay_general @@ -1886,19 +1886,12 @@ ID: vgdisplay_columns DESC: Display output in columns like vgs. vgdisplay --colon -OO: OO_REPORTING +OO: OO_REPORTING, --activevolumegroups OP: VG|Tag ... IO: --partial, --ignoreskippedcluster ID: vgdisplay_colon DESC: Generate colon separated output. -vgdisplay --activevolumegroups -OO: OO_REPORTING, --short, --colon -IO: --partial, --ignoreskippedcluster -ID: vgdisplay_active -RULE: --short not --colon -DESC: Display Volume Groups with active LVs. - --- OO_VGEXPORT: --reportformat ReportFmt diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 8e16f202d..be50473c8 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -101,7 +101,6 @@ static const struct command_function _command_functions[CMD_COUNT] = { /* vgdisplay variants */ { vgdisplay_columns_CMD, vgdisplay_columns_cmd }, { vgdisplay_colon_CMD, vgdisplay_colon_cmd }, - { vgdisplay_active_CMD, vgdisplay_active_cmd }, { vgdisplay_general_CMD, vgdisplay_general_cmd }, /* lvconvert utilities related to repair. */ diff --git a/tools/tools.h b/tools/tools.h index 46ae7206b..d169f2591 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -196,7 +196,6 @@ 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); int vgdisplay_general_cmd(struct cmd_context *cmd, int argc, char **argv); -int vgdisplay_active_cmd(struct cmd_context *cmd, int argc, char **argv); int lvconvert_repair_cmd(struct cmd_context *cmd, int argc, char **argv); int lvconvert_replace_pv_cmd(struct cmd_context *cmd, int argc, char **argv); diff --git a/tools/vgdisplay.c b/tools/vgdisplay.c index 87de7d977..421dadec5 100644 --- a/tools/vgdisplay.c +++ b/tools/vgdisplay.c @@ -59,20 +59,22 @@ static int _vgdisplay_general_single(struct cmd_context *cmd, const char *vg_nam int vgdisplay_colon_cmd(struct cmd_context *cmd, int argc, char **argv) { + if (argc && arg_is_set(cmd, activevolumegroups_ARG)) { + log_error("Option -A is not allowed with volume group names"); + return EINVALID_CMD_LINE; + } + return process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, _vgdisplay_colon_single); } int vgdisplay_general_cmd(struct cmd_context *cmd, int argc, char **argv) { - return process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, _vgdisplay_general_single); -} + if (argc && arg_is_set(cmd, activevolumegroups_ARG)) { + log_error("Option -A is not allowed with volume group names"); + return EINVALID_CMD_LINE; + } -int vgdisplay_active_cmd(struct cmd_context *cmd, int argc, char **argv) -{ - if (arg_is_set(cmd, colon_ARG)) - return process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, _vgdisplay_colon_single); - else - return process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, _vgdisplay_general_single); + return process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, _vgdisplay_general_single); } int vgdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv) -- 2.43.5