mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
vsh: Fix option formatting for 'VHS_OT_ARGV' options
While previous fixes kept the help output unchanged as base for the refactors it turns out that the formatting of help for argv options is wrong. Specifically in SYNOPSIS the non-positional _ARGV would have the option name in square brackets (which in other cases means that given thing is optional) despite being required. Similarly in the DESCRIPTION section positional versions would not show the optional argument name and also didn't use the three dots to signal that it can be used multiple times. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e9e3d6dff4
commit
baa20d6eb8
@ -714,9 +714,9 @@ vshCmddefHelp(const vshCmdDef *def)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (opt->required) {
|
if (opt->required) {
|
||||||
fprintf(stdout, _(" {[--%1$s] <string>}..."), opt->name);
|
fprintf(stdout, _(" --%1$s <string>..."), opt->name);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stdout, _(" [[--%1$s] <string>]..."), opt->name);
|
fprintf(stdout, _(" [--%1$s <string>]..."), opt->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -765,9 +765,9 @@ vshCmddefHelp(const vshCmdDef *def)
|
|||||||
|
|
||||||
case VSH_OT_ARGV:
|
case VSH_OT_ARGV:
|
||||||
if (opt->positional) {
|
if (opt->positional) {
|
||||||
optstr = g_strdup_printf("<%s>", opt->name);
|
optstr = g_strdup_printf(_("[--%1$s] <string>..."), opt->name);
|
||||||
} else {
|
} else {
|
||||||
optstr = g_strdup_printf(_("[--%1$s] <string>"), opt->name);
|
optstr = g_strdup_printf(_("--%1$s <string>..."), opt->name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user