1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

man/help: use order of required options from cmd def

Follow the same as written in command-lines.in
This commit is contained in:
David Teigland 2017-03-08 14:51:08 -06:00
parent 3d5182c819
commit 4d0172ff15
2 changed files with 5 additions and 30 deletions

View File

@ -350,7 +350,8 @@ lvconvert --type raid LV
OO: OO_LVCONVERT_RAID, OO_LVCONVERT
OP: PV ...
ID: lvconvert_raid_types
DESC: Convert LV to raid or change raid layout.
DESC: Convert LV to raid or change raid layout
DESC: (a specific raid level must be used, e.g. raid1).
RULE: all not lv_is_locked lv_is_pvmove
lvconvert --mirrors SNumber LV

View File

@ -1698,8 +1698,6 @@ void print_usage(struct command *cmd, int longhelp, int desc_first)
if (cmd->ro_count) {
first = 1;
/* print options with short opts */
for (ro = 0; ro < cmd->ro_count; ro++) {
opt_enum = cmd->required_opt_args[ro].opt;
@ -1717,35 +1715,11 @@ void print_usage(struct command *cmd, int longhelp, int desc_first)
first = 0;
}
printf(" -%c|%s", opt_names[opt_enum].short_opt, opt_names[opt_enum].long_opt);
if (cmd->required_opt_args[ro].def.val_bits) {
printf(" ");
print_usage_def(cmd, opt_enum, &cmd->required_opt_args[ro].def);
}
}
/* print options without short opts */
for (ro = 0; ro < cmd->ro_count; ro++) {
opt_enum = cmd->required_opt_args[ro].opt;
if (opt_names[opt_enum].short_opt)
continue;
printf(" -%c|%s", opt_names[opt_enum].short_opt, opt_names[opt_enum].long_opt);
else
printf(" %s", opt_names[opt_enum].long_opt);
if ((opt_enum == size_ARG) && command_has_alternate_extents(cmd->name))
include_extents = 1;
if (onereq) {
if (first)
printf("\n\t(");
else {
printf(",\n\t ");
printf(" "); /* align for no short opt */
}
first = 0;
}
printf(" %s", opt_names[opt_enum].long_opt);
if (cmd->required_opt_args[ro].def.val_bits) {
printf(" ");
print_usage_def(cmd, opt_enum, &cmd->required_opt_args[ro].def);