Skip to content

Commit

Permalink
man-pages: consolidate COLORS section
Browse files Browse the repository at this point in the history
* use man-common/colors.adoc include file

* improve description and add example how to disable colors globally
  or for specific tool

Addresses: util-linux#1593
Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information
karelzak committed Feb 9, 2022
1 parent 93965a9 commit 6c62faf
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 33 deletions.
7 changes: 1 addition & 6 deletions disk-utils/cfdisk.8.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,7 @@ Select the preceding or the next menu item. Hitting _Enter_ will execute the cur

All commands can be entered with either uppercase or lowercase letters (except for **W**rite). When in a submenu or at a prompt, you can hit the _Esc_ key to return to the main menu.

== COLORS

Implicit coloring can be disabled by creating the empty file _/etc/terminal-colors.d/cfdisk.disable_.

See *terminal-colors.d*(5) for more details about colorization configuration.

include::man-common/colors.adoc[]
*cfdisk* does not support color customization with a color-scheme file.

== ENVIRONMENT
Expand Down
7 changes: 2 additions & 5 deletions disk-utils/fdisk.8.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,8 @@ Some versions of MS-DOS create a first partition which does not begin on a cylin

For best results, you should always use an OS-specific partition table program. For example, you should make DOS partitions with the DOS FDISK program and Linux partitions with the Linux *fdisk* or Linux *cfdisk*(8) programs.

== COLORS

Implicit coloring can be disabled by an empty file _/etc/terminal-colors.d/fdisk.disable_.

See *terminal-colors.d*(5) for more details about colorization configuration. The logical color names supported by *fdisk* are:
include::man-common/colors.adoc[]
The logical color names supported by *fdisk* are:

*header*::
The header of the output tables.
Expand Down
6 changes: 2 additions & 4 deletions disk-utils/sfdisk.8.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,9 @@ The same concept of backup files is used by *wipefs*(8).

Note that *sfdisk* since version 2.26 no longer provides the *-I* option to restore sectors. *dd*(1) provides all necessary functionality.

== COLORS
include::man-common/colors.adoc[]

Implicit coloring can be disabled by an empty file _/etc/terminal-colors.d/sfdisk.disable_.

See *terminal-colors.d*(5) for more details about colorization configuration. The logical color names supported by *sfdisk* are:
The logical color names supported by *sfdisk* are:

*header*::
The header of the output tables.
Expand Down
17 changes: 17 additions & 0 deletions man-common/colors.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
== COLORS

The output colorization is implemented by *terminal-colors.d(5)* functionality.
Implicit coloring can be disabled by an empty file
____
_/etc/terminal-colors.d/{command}.disable_
____
for the {command} or for all tools by
____
_/etc/terminal-colors.d/disable_
____
The user-specific _$XDG_CONFIG_HOME/terminal-colors.d_
or _$HOME/.config/terminal-colors.d_ overrides the global setting.

Note that the output colorization may be enabled by default, and in this case
_terminal-colors.d_ directories do not have to exist yet.

10 changes: 1 addition & 9 deletions misc-utils/cal.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,7 @@ A year starts on January 1. The first day of the week is determined by the local
The week numbering depends on the choice of the first day of the week. If it is Sunday then the customary North American numbering is used, where 1 January is in week number 1. If it is Monday (*-m*) then the ISO 8601 standard week numbering is used, where the first Thursday is in week number 1.
== COLORS
Implicit coloring can be disabled as follows:
____
*touch /etc/terminal-colors.d/cal.disable*
____
See *terminal-colors.d*(5) for more details about colorization configuration.
include::man-common/colors.adoc[]
== HISTORY
Expand Down
5 changes: 1 addition & 4 deletions sys-utils/dmesg.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ Decode facility and level (priority) numbers to human-readable prefixes.

include::man-common/help-version.adoc[]

== COLORS

Implicit coloring can be disabled by an empty file _/etc/terminal-colors.d/dmesg.disable_. See *terminal-colors.d*(5) for more details about colorization configuration.

include::man-common/colors.adoc[]
The logical color names supported by *dmesg* are:

*subsys*::
Expand Down
6 changes: 1 addition & 5 deletions text-utils/hexdump.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,7 @@ MBR Boot Signature example: Highlight the addresses cyan and the bytes at offset
"%07.7_ax_L[cyan] " 8/2 " %04x_L[green:0xAA55@510-511,!red:0xAA55@510-511] " "\n"
....
== COLORS
Implicit coloring can be disabled by an empty file _/etc/terminal-colors.d/hexdump.disable_.
See *terminal-colors.d*(5) for more details about colorization configuration.
include::man-common/colors.adoc[]
include::man-common/bugreports.adoc[]
Expand Down

0 comments on commit 6c62faf

Please sign in to comment.