diff options
author | Karel Zak <kzak@redhat.com> | 2015-02-25 12:37:55 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2015-03-12 10:13:10 +0100 |
commit | 66fa91d6f485d1605f4ce758ffa8be575a403921 (patch) | |
tree | adf37df69448f1435a0444813c7f303eea95ec9c | |
parent | 3d3f623dbd30af1d4a1c326e17a40ff756135531 (diff) | |
download | util-linux-66fa91d6f485d1605f4ce758ffa8be575a403921.tar.gz |
colors: cleanup man pages, add hint to usage()
cfdisk, fdisk, calm dmesg and hexdump
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | disk-utils/cfdisk.8 | 7 | ||||
-rw-r--r-- | disk-utils/cfdisk.c | 6 | ||||
-rw-r--r-- | disk-utils/fdisk.8 | 6 | ||||
-rw-r--r-- | disk-utils/fdisk.c | 3 | ||||
-rw-r--r-- | misc-utils/cal.1 | 21 | ||||
-rw-r--r-- | misc-utils/cal.c | 3 | ||||
-rw-r--r-- | sys-utils/dmesg.1 | 5 | ||||
-rw-r--r-- | sys-utils/dmesg.c | 2 | ||||
-rw-r--r-- | text-utils/hexdump.1 | 5 | ||||
-rw-r--r-- | text-utils/hexdump.c | 2 |
10 files changed, 35 insertions, 25 deletions
diff --git a/disk-utils/cfdisk.8 b/disk-utils/cfdisk.8 index a6b579822..79f85cf5b 100644 --- a/disk-utils/cfdisk.8 +++ b/disk-utils/cfdisk.8 @@ -56,9 +56,10 @@ If you want to remove an old partition table from a device, use Display help text and exit. .TP .BR \-L , " \-\-color" [ = \fIwhen\fR] -Colorize the output; enabled by default. The optional argument \fIwhen\fP can be -\fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted, -it defaults to \fBauto\fR. +Colorize the output. The optional argument \fIwhen\fP +can be \fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted, +it defaults to \fBauto\fR. The colors can be disabled, for the current built-in default +see \fB\-\-help\fR output. See also the COLORS section. .TP .BR \-V , " \-\-version" Display version information and exit. diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index aa989ec0d..e60d9e400 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -2203,8 +2203,10 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out) fputs(_("Display or manipulate a disk partition table.\n"), out); fputs(USAGE_OPTIONS, out); - fputs(_(" -L --color[=<when>] colorize output (auto, always or never)\n"), out); - fputs(_(" -z --zero start with zeroed partition table\n"), out); + fputs(_(" -L, --color[=<when>] colorize output (auto, always or never)\n"), out); + fprintf(out, + " %s\n", USAGE_COLORS_DEFAULT); + fputs(_(" -z, --zero start with zeroed partition table\n"), out); fputs(USAGE_SEPARATOR, out); fputs(USAGE_HELP, out); diff --git a/disk-utils/fdisk.8 b/disk-utils/fdisk.8 index 89ae5aaaa..1350d0257 100644 --- a/disk-utils/fdisk.8 +++ b/disk-utils/fdisk.8 @@ -64,8 +64,10 @@ the correct form is for example '-c=dos'. Display a help text and exit. .TP \fB\-L\fR, \fB\-\-color\fR[\fI=when\fR] -Colorize the output in interactive mode. The optional argument \fIwhen\fP can -be \fBauto\fR, \fBnever\fR or \fBalways\fR. The default is \fBauto\fR. +Colorize the output. The optional argument \fIwhen\fP +can be \fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted, +it defaults to \fBauto\fR. The colors can be disabled, for the current built-in default +see \fB\-\-help\fR output. See also the COLORS section. .TP \fB\-l\fR, \fB\-\-list\fR List the partition tables for the specified devices and then exit. diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c index 8a0bfd575..0556ca8c1 100644 --- a/disk-utils/fdisk.c +++ b/disk-utils/fdisk.c @@ -645,6 +645,8 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out) fputs(_(" -b, --sector-size <size> physical and logical sector size\n"), out); fputs(_(" -c, --compatibility[=<mode>] mode is 'dos' or 'nondos' (default)\n"), out); fputs(_(" -L, --color[=<when>] colorize output (auto, always or never)\n"), out); + fprintf(out, + " %s\n", USAGE_COLORS_DEFAULT); fputs(_(" -l, --list display partitions end exit\n"), out); fputs(_(" -o, --output <list> output columns\n"), out); fputs(_(" -t, --type <type> recognize specified partition table type only\n"), out); @@ -769,6 +771,7 @@ int main(int argc, char **argv) act = ACT_LIST; break; case 'L': + colormode = UL_COLORMODE_AUTO; if (optarg) colormode = colormode_or_err(optarg, _("unsupported color mode")); diff --git a/misc-utils/cal.1 b/misc-utils/cal.1 index 92141ae9e..0a1600d0e 100644 --- a/misc-utils/cal.1 +++ b/misc-utils/cal.1 @@ -70,18 +70,10 @@ Display a calendar for the whole year. Display week numbers in the calendar (US or ISO-8601). .TP \fB\-\-color\fR[\fI=when\fR] -Colorize output. The -.I when -can be -.IR never , -.IR auto , -or -.IR always . -Never will turn off colorizing in all situations. Auto is default, and -it will make colorizing to be in use if output is done to terminal. -Always will allow colors to be outputed when -.B cal -outputs to pipe, or is called from a script. +Colorize the output. The optional argument \fIwhen\fP +can be \fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted, +it defaults to \fBauto\fR. The colors can be disabled, for the current built-in default +see \fB\-\-help\fR output. See also the COLORS section. .TP \fB\-V\fR, \fB\-\-version\fR Display version information and exit. @@ -117,8 +109,9 @@ Implicit coloring can be disabled as follows: .br .RE -For more details see -.BR terminal-colors.d (5). +See +.BR terminal-colors.d (5) +for more details about colorization configuration. .SH BUGS .PP The diff --git a/misc-utils/cal.c b/misc-utils/cal.c index 2311d0188..d6d4a0f25 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -369,6 +369,7 @@ int main(int argc, char **argv) ctl.weektype = WEEK_NUM_US; /* default per weekstart */ break; case OPT_COLOR: + ctl.colormode = UL_COLORMODE_AUTO; if (optarg) ctl.colormode = colormode_or_err(optarg, _("unsupported color mode")); @@ -937,6 +938,8 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out) fputs(_(" -y, --year show the whole year\n"), out); fputs(_(" -w, --week[=<num>] show US or ISO-8601 week numbers\n"), out); fputs(_(" --color[=<when>] colorize messages (auto, always or never)\n"), out); + fprintf(out, + " %s\n", USAGE_COLORS_DEFAULT); fputs(USAGE_SEPARATOR, out); fputs(USAGE_HELP, out); diff --git a/sys-utils/dmesg.1 b/sys-utils/dmesg.1 index a28a4f922..d8209aceb 100644 --- a/sys-utils/dmesg.1 +++ b/sys-utils/dmesg.1 @@ -68,9 +68,10 @@ and \fB\-\-nopager\fR. .IP "\fB\-k\fR, \fB\-\-kernel\fR" Print kernel messages. .IP "\fB\-L\fR, \fB\-\-color\fR[=\fIwhen\fR]" -Colorize important messages (enabled by default). The optional argument \fIwhen\fP +Colorize the output. The optional argument \fIwhen\fP can be \fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted, -it defaults to \fBauto\fR. +it defaults to \fBauto\fR. The colors can be disabled, for the current built-in default +see \fB\-\-help\fR output. See also the COLORS section. .IP "\fB\-l\fR, \fB\-\-level \fIlist\fR" Restrict output to the given (comma-separated) .I list diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index 8360fa311..5a6ee41d9 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -276,6 +276,8 @@ static void __attribute__((__noreturn__)) usage(FILE *out) fputs(_(" -H, --human human readable output\n"), out); fputs(_(" -k, --kernel display kernel messages\n"), out); fputs(_(" -L, --color[=<when>] colorize messages (auto, always or never)\n"), out); + fprintf(out, + " %s\n", USAGE_COLORS_DEFAULT); fputs(_(" -l, --level <list> restrict output to defined levels\n"), out); fputs(_(" -n, --console-level <level> set level of messages printed to console\n"), out); fputs(_(" -P, --nopager do not pipe output into a pager\n"), out); diff --git a/text-utils/hexdump.1 b/text-utils/hexdump.1 index f99276367..d20f63e94 100644 --- a/text-utils/hexdump.1 +++ b/text-utils/hexdump.1 @@ -82,9 +82,10 @@ Empty lines and lines whose first non-blank character is a hash mark (\&#) are ignored. .TP \fB\-L\fR, \fB\-\-color\fR[=\fIwhen\fR] -Accept color units for the output (enabled by default). The optional argument \fIwhen\fP +Accept color units for the output. The optional argument \fIwhen\fP can be \fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted, -then it defaults to \fBauto\fR. +it defaults to \fBauto\fR. The colors can be disabled, for the current built-in default +see \fB\-\-help\fR output. See also the COLORS section. .TP \fB\-n\fR, \fB\-\-length\fR \fIlength\fR Interpret only diff --git a/text-utils/hexdump.c b/text-utils/hexdump.c index 9ee5cb7c9..cc1fdf1b8 100644 --- a/text-utils/hexdump.c +++ b/text-utils/hexdump.c @@ -165,6 +165,8 @@ void __attribute__((__noreturn__)) usage(FILE *out) fputs(_(" -o, --two-bytes-octal two-byte octal display\n"), out); fputs(_(" -x, --two-bytes-hex two-byte hexadecimal display\n"), out); fputs(_(" -L, --color[=<mode>] interpret color formatting specifiers\n"), out); + fprintf(out, + " %s\n", USAGE_COLORS_DEFAULT); fputs(_(" -e, --format <format> format string to be used for displaying data\n"), out); fputs(_(" -f, --format-file <file> file that contains format strings\n"), out); fputs(_(" -n, --length <length> interpret only length bytes of input\n"), out); |