From: Karel Zak Date: Wed, 9 Feb 2022 10:56:36 +0000 (+0100) Subject: man-pages: consolidate COLORS section X-Git-Tag: v2.38-rc2~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c62faf14927a4f8aeaf04c4d0117fa6bd37d6a2;p=thirdparty%2Futil-linux.git man-pages: consolidate COLORS section * use man-common/colors.adoc include file * improve description and add example how to disable colors globally or for specific tool Addresses: https://github.com/util-linux/util-linux/issues/1593 Signed-off-by: Karel Zak --- diff --git a/disk-utils/cfdisk.8.adoc b/disk-utils/cfdisk.8.adoc index 59fb80269c..9e2b2663aa 100644 --- a/disk-utils/cfdisk.8.adoc +++ b/disk-utils/cfdisk.8.adoc @@ -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 diff --git a/disk-utils/fdisk.8.adoc b/disk-utils/fdisk.8.adoc index a9933c3f59..e40c1cf3cc 100644 --- a/disk-utils/fdisk.8.adoc +++ b/disk-utils/fdisk.8.adoc @@ -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. diff --git a/disk-utils/sfdisk.8.adoc b/disk-utils/sfdisk.8.adoc index f5896710ba..8d0f388f43 100644 --- a/disk-utils/sfdisk.8.adoc +++ b/disk-utils/sfdisk.8.adoc @@ -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. diff --git a/man-common/colors.adoc b/man-common/colors.adoc new file mode 100644 index 0000000000..4ae370f4cf --- /dev/null +++ b/man-common/colors.adoc @@ -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. + diff --git a/misc-utils/cal.1.adoc b/misc-utils/cal.1.adoc index 67a0d84028..fde97a8655 100644 --- a/misc-utils/cal.1.adoc +++ b/misc-utils/cal.1.adoc @@ -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 diff --git a/sys-utils/dmesg.1.adoc b/sys-utils/dmesg.1.adoc index 64b9146d66..9072f224c6 100644 --- a/sys-utils/dmesg.1.adoc +++ b/sys-utils/dmesg.1.adoc @@ -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*:: diff --git a/text-utils/hexdump.1.adoc b/text-utils/hexdump.1.adoc index a4f13761d9..ce475fde66 100644 --- a/text-utils/hexdump.1.adoc +++ b/text-utils/hexdump.1.adoc @@ -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[]