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

man/help: change syntax to UNIT

(Change to recent commit 3f4ecaf8c2.)

Use --foo Number[k|UNIT] to indicate that
the default units of the number is k, but other
units listed below are also accepted.

Previously, underlined/italic Unit was used,
like other of variables, but this UNIT is more
like a shortcut than an actual variable.
This commit is contained in:
David Teigland 2017-02-23 14:24:28 -06:00
parent 8ab0725077
commit 3fd3c9430d
2 changed files with 15 additions and 13 deletions

View File

@ -1786,19 +1786,19 @@ static void print_val_man(const char *str)
int i;
/*
* Doing bold k before underlined Unit creates a lot of
* Doing bold k before UNIT creates a lot of
* visual "noise" that makes the text hard to read.
* The extra markup in this case doesn't add anything
* that isn't already obvious.
*/
if (!strcmp(str, "Number[k|Unit]")) {
printf("\\fINumber\\fP[k|\\fIUnit\\fP]");
if (!strcmp(str, "Number[k|UNIT]")) {
printf("\\fINumber\\fP[k|UNIT]");
return;
}
if (!strcmp(str, "Number[m|Unit]")) {
printf("\\fINumber\\fP[m|\\fIUnit\\fP]");
if (!strcmp(str, "Number[m|UNIT]")) {
printf("\\fINumber\\fP[m|UNIT]");
return;
}
@ -2798,13 +2798,15 @@ void print_man_all_positions_desc(struct command_name *cname)
/* Nearly every command uses a number arg somewhere. */
printf("\n.HP\n");
printf("\\fINumber\\fP, \\fIUnit\\fP");
printf("\\fINumber\\fP, UNIT");
printf("\n");
printf(".br\n");
printf("Input units are always treated as base two values, regardless of unit\n"
"capitalization, e.g. 'k' and 'K' both refer to 1024.\n"
"The default input unit is specified by letter, followed by |\\fIUnit\\fP\n"
"which represents other possible input units: \\fBbBsSkKmMgGtTpPeE\\fP.\n");
"The default input unit is specified by letter, followed by |UNIT\n"
"which represents other possible input units: \\fBbBsSkKmMgGtTpPeE\\fP.\n"
"(This should not be confused with the output control --units, where\n"
"capital letters mean multiple of 1000.)\n");
printf("\n.HP\n");
printf("Environment");

View File

@ -85,8 +85,8 @@
* output, and doesn't indicate which unit is the default.
* "Number[Units]" would be cleaner, as would a subset of
* common units, e.g. "Number[kmg...]", but neither helps
* with default. "Number[k|Unit]" and "Number[m|Unit]" show
* the default, and "Unit" indicates that other units
* with default. "Number[k|UNIT]" and "Number[m|UNIT]" show
* the default, and "UNIT" indicates that other units
* are possible without listing them all. This also
* suggests using the preferred lower case letters, because
* --size and other option args treat upper/lower letters
@ -115,9 +115,9 @@ val(activation_VAL, activation_arg, "Active", "y|n|ay")
val(cachemode_VAL, cachemode_arg, "CacheMode", "writethrough|writeback")
val(discards_VAL, discards_arg, "Discards", "passdown|nopassdown|ignore")
val(mirrorlog_VAL, mirrorlog_arg, "MirrorLog", "core|disk")
val(sizekb_VAL, size_kb_arg, "SizeKB", "Number[k|Unit]")
val(sizemb_VAL, size_mb_arg, "SizeMB", "Number[m|Unit]")
val(regionsize_VAL, regionsize_arg, "RegionSize", "Number[m|Unit]")
val(sizekb_VAL, size_kb_arg, "SizeKB", "Number[k|UNIT]")
val(sizemb_VAL, size_mb_arg, "SizeMB", "Number[m|UNIT]")
val(regionsize_VAL, regionsize_arg, "RegionSize", "Number[m|UNIT]")
val(numsigned_VAL, int_arg_with_sign, "SNumber", "[+|-]Number")
val(numsignedper_VAL, int_arg_with_sign_and_percent, "SNumberP", "[+|-]Number[%VG|%PVS|%FREE]")
val(permission_VAL, permission_arg, "Permission", "rw|r")