]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
colors: cleanup man pages, add hint to usage()
authorKarel Zak <kzak@redhat.com>
Wed, 25 Feb 2015 11:37:55 +0000 (12:37 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 25 Feb 2015 11:40:06 +0000 (12:40 +0100)
 cfdisk, fdisk, calm dmesg and hexdump

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/cfdisk.8
disk-utils/cfdisk.c
disk-utils/fdisk.8
disk-utils/fdisk.c
misc-utils/cal.1
misc-utils/cal.c
sys-utils/dmesg.1
sys-utils/dmesg.c
text-utils/hexdump.1
text-utils/hexdump.c

index a6b5798225bdf8bfb1a011416ca4136c32d8f5f6..79f85cf5b660e4fc5f3176946beaea76abf09a07 100644 (file)
@@ -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.
index aa989ec0d90f3da3db360b67750c08291ecfbf96..e60d9e400c2c6f2b237ec169d7540ebaeec863a8 100644 (file)
@@ -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);
index 89ae5aaaabbeb366372c529d7ec2c75ce203d9f1..1350d025720323c4a521fb62fca13aeab42e0792 100644 (file)
@@ -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.
index 815f3f3eb0391c225ef1c813cccf6efccd2c8f61..6c63d06cd630495613aa0cb4e4f3ec88642bfa23 100644 (file)
@@ -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"));
index 92141ae9eba122b12639a84b43844eb62bd67d67..0a1600d0e94f85cacff4d02b09631dceedb48dbb 100644 (file)
@@ -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
index 2311d01888e3a45f3228da05b1148e84b702be2a..d6d4a0f25898dd0bc31ecc7c3f688d107e83ffdf 100644 (file)
@@ -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);
index a28a4f9224454b816d8904beb9a7e32abe7d2f05..d8209aceb3797a684b4c48a110e7a772faf1dbad 100644 (file)
@@ -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
index 8360fa3116c8176984467e8c53fa88b2ed696d7a..5a6ee41d95bc4d1873d3887157251e4a8bd885df 100644 (file)
@@ -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);
index f992763678605890be79bbd86d7b2441bca2eeec..d20f63e947d98cf7fac630854349da833bf1b8a6 100644 (file)
@@ -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
index 9ee5cb7c9d8e7c1bb0a174082edcf449b439412a..cc1fdf1b8bf79cc75ebd177e15e78740c2fb486f 100644 (file)
@@ -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);