1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tools: enhance lvdisplay vgdisplay pvdisplay

Split description for display commands so we can better describe
it's usage and combination of individual options in man page.

Now we can separately describe:

lvdisplay, lvdisplay -c, lvdisplay -C
vgdisplay, vgdisplay -c, vgdisplay -C
pvdisplay, pvdisplay -c, pvdisplay -C

TODO: Drop validation from command code itself.
This commit is contained in:
Zdenek Kabelac 2024-11-22 13:25:29 +01:00
parent 502543ffed
commit e8e4324d68
6 changed files with 108 additions and 28 deletions

View File

@ -206,15 +206,20 @@ OO_ALL: --commandprofile String, --config String, --debug,
--driverloaded Bool, --help, --nolocking, --lockopt String, --longhelp, --profile String, --quiet, --driverloaded Bool, --help, --nolocking, --lockopt String, --longhelp, --profile String, --quiet,
--verbose, --version, --yes, --test, --devicesfile String, --devices PV, --nohints --journal String --verbose, --version, --yes, --test, --devicesfile String, --devices PV, --nohints --journal String
#
# options for pvdisplay, lvdisplay, vgdisplay
#
OO_REPORTING: --all, --configreport ConfigReport, --foreign,
--ignorelockingfailure, --logonly, --readonly, --reportformat ReportFmt,
--select String, --shared, --sort String, --units Units
# #
# options for pvs, lvs, vgs, fullreport # options for pvs, lvs, vgs, fullreport
# #
OO_REPORT: --aligned, --all, --binary, --configreport ConfigReport, --foreign, OO_REPORT: OO_REPORTING, --aligned, --binary,
--headings HeadingsType --ignorelockingfailure, --logonly, --headings HeadingsType, --nameprefixes, --noheadings,
--nameprefixes, --noheadings, --nosuffix, --nosuffix, --options String, --rows, --separator String,
--options String, --readonly, --reportformat ReportFmt, --rows, --unbuffered, --unquoted
--select String, --separator String, --shared, --sort String,
--unbuffered, --units Units, --unquoted
# #
# options for config, dumpconfig, lvmconfig # options for config, dumpconfig, lvmconfig
@ -1386,15 +1391,23 @@ DESC: new LV to type writecache.
--- ---
lvdisplay lvdisplay --columns
OO: --aligned, --all, --binary, --colon, --columns, OO: OO_REPORT, --history, --segments
--configreport ConfigReport, --foreign, --history, --ignorelockingfailure,
--logonly, --maps, --noheadings,
--nosuffix, --options String, --sort String, --readonly,
--segments, --select String, --separator String,
--shared, --unbuffered, --units Units
OP: VG|LV|Tag ... OP: VG|LV|Tag ...
IO: --partial, --ignoreskippedcluster, --reportformat ReportFmt IO: --partial, --ignoreskippedcluster
RULE: --noheadings not --headings
ID: lvdisplay_columns
lvdisplay --colon
OO: OO_REPORTING, --history, --segments
OP: VG|LV|Tag ...
IO: --partial, --ignoreskippedcluster
ID: lvdisplay_colon
lvdisplay
OO: OO_REPORTING, --history, --segments, --maps
OP: VG|LV|Tag ...
IO: --partial, --ignoreskippedcluster
ID: lvdisplay_general ID: lvdisplay_general
--- ---
@ -1622,14 +1635,23 @@ RULE: --bootloaderareasize not --restorefile
--- ---
pvdisplay pvdisplay --columns
OO: --aligned, --all, --binary, --colon, --columns, --configreport ConfigReport, OO: OO_REPORT, --segments
--foreign, --ignorelockingfailure,
--logonly, --maps, --noheadings, --nosuffix, --options String,
--readonly, --reportformat ReportFmt, --select String, --separator String, --shared,
--short, --sort String, --unbuffered, --units Units
OP: PV|Tag ... OP: PV|Tag ...
IO: --ignoreskippedcluster IO: --partial, --ignoreskippedcluster
RULE: --noheadings not --headings
ID: pvdisplay_columns
pvdisplay --colon
OO: OO_REPORTING, --segments
OP: PV|Tag ...
IO: --partial, --ignoreskippedcluster
ID: pvdisplay_colon
pvdisplay
OO: OO_REPORTING, --maps, --segments, --short
OP: PV|Tag ...
IO: --partial, --ignoreskippedcluster
ID: pvdisplay_general ID: pvdisplay_general
--- ---
@ -1845,14 +1867,23 @@ ID: vgcreate_general
--- ---
vgdisplay vgdisplay --columns
OO: --activevolumegroups, --aligned, --binary, --colon, --columns, OO: OO_REPORT, --activevolumegroups
--configreport ConfigReport, --foreign, --ignorelockingfailure,
--logonly, --noheadings, --nosuffix,
--options String, --readonly, --select String,
--shared, --short, --separator String, --sort String, --unbuffered, --units Units
OP: VG|Tag ... OP: VG|Tag ...
IO: --partial, --ignoreskippedcluster, --reportformat ReportFmt IO: --partial, --ignoreskippedcluster
RULE: --noheadings not --headings
ID: vgdisplay_columns
vgdisplay --colon
OO: OO_REPORTING, --activevolumegroups
OP: VG|Tag ...
IO: --partial, --ignoreskippedcluster
ID: vgdisplay_colon
vgdisplay
OO: OO_REPORTING, --activevolumegroups, --short
OP: VG|Tag ...
IO: --partial, --ignoreskippedcluster
ID: vgdisplay_general ID: vgdisplay_general
--- ---

View File

@ -60,3 +60,13 @@ int lvdisplay(struct cmd_context *cmd, int argc, char **argv)
return process_each_lv(cmd, argc, argv, NULL, NULL, 0, NULL, NULL, &_lvdisplay_single); return process_each_lv(cmd, argc, argv, NULL, NULL, 0, NULL, NULL, &_lvdisplay_single);
} }
int lvdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv)
{
return lvdisplay(cmd, argc, argv);
}
int lvdisplay_colon_cmd(struct cmd_context *cmd, int argc, char **argv)
{
return lvdisplay(cmd, argc, argv);
}

View File

@ -88,6 +88,18 @@ static const struct command_function _command_functions[CMD_COUNT] = {
{ vgchange_lockstop_CMD, vgchange_lock_start_stop_cmd }, { vgchange_lockstop_CMD, vgchange_lock_start_stop_cmd },
{ vgchange_systemid_CMD, vgchange_systemid_cmd }, { vgchange_systemid_CMD, vgchange_systemid_cmd },
/* lvdisplay variants */
{ lvdisplay_columns_CMD, lvdisplay_columns_cmd },
{ lvdisplay_colon_CMD, lvdisplay_colon_cmd },
/* pvdisplay variants */
{ pvdisplay_columns_CMD, pvdisplay_columns_cmd },
{ pvdisplay_colon_CMD, pvdisplay_colon_cmd },
/* vgdisplay variants */
{ vgdisplay_columns_CMD, vgdisplay_columns_cmd },
{ vgdisplay_colon_CMD, vgdisplay_colon_cmd },
/* lvconvert utilities related to repair. */ /* lvconvert utilities related to repair. */
{ lvconvert_repair_CMD, lvconvert_repair_cmd }, { lvconvert_repair_CMD, lvconvert_repair_cmd },
{ lvconvert_replace_pv_CMD, lvconvert_replace_pv_cmd }, { lvconvert_replace_pv_CMD, lvconvert_replace_pv_cmd },

View File

@ -106,3 +106,13 @@ int pvdisplay(struct cmd_context *cmd, int argc, char **argv)
return ret; return ret;
} }
int pvdisplay_columns_cmd(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);
}

View File

@ -188,6 +188,13 @@ int lvchange_rebuild_cmd(struct cmd_context *cmd, int argc, char **argv);
int lvchange_monitor_poll_cmd(struct cmd_context *cmd, int argc, char **argv); int lvchange_monitor_poll_cmd(struct cmd_context *cmd, int argc, char **argv);
int lvchange_persistent_cmd(struct cmd_context *cmd, int argc, char **argv); int lvchange_persistent_cmd(struct cmd_context *cmd, int argc, char **argv);
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 pvdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv);
int pvdisplay_colon_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 lvconvert_repair_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); int lvconvert_replace_pv_cmd(struct cmd_context *cmd, int argc, char **argv);

View File

@ -107,3 +107,13 @@ int vgdisplay(struct cmd_context *cmd, int argc, char **argv)
} }
************/ ************/
} }
int vgdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv)
{
return vgdisplay(cmd, argc, argv);
}
int vgdisplay_colon_cmd(struct cmd_context *cmd, int argc, char **argv)
{
return vgdisplay(cmd, argc, argv);
}