cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 6734c271ae0127a765d99ed48dbbebf2c72fb63b
parent 0a5dc942f092fbee2e98d658376a3b21183761ee
Author: Cem Keylan <cem@ckyln.com>
Date:   Thu, 14 May 2020 11:38:13 +0300

kiss: change KISS_COLOUR variable to KISS_COLOR

American English smh...

Diffstat:
MCHANGELOG.md | 8++++++++
Mkiss | 18+++++++++---------
Mman/kiss.1 | 6+++---
3 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -8,6 +8,14 @@ this project _somewhat_ adheres to [Semantic Versioning]. [Semantic Versioning]: https://semver.org/spec/v2.0.0.html +UNRELEASED +---------- + +### Changed +- Replaced `KISS_COLOUR` with `KISS_COLOR` to match upstream. +- Renamed `colour` variable to `color` for consistency. + + 1.21.1 - 2020-05-14 ------------------- diff --git a/kiss b/kiss @@ -1450,7 +1450,7 @@ args() { if [ -f "$sys_db/$pkg/message" ]; then printf '%s\n%b%s%b\n%s\n\n' \ "==============================" \ - "${colour:+"\033[1m"}" "$pkg" "${colour:+"\033[m"}" \ + "${color:+"\033[1m"}" "$pkg" "${color:+"\033[m"}" \ "==============================" >&2 cat "$sys_db/$pkg/message" >&2 msg=1 @@ -1474,7 +1474,7 @@ args() { # These are binary files so they should be ignored contains "readlink stat" "$path" && continue - printf '%b->%b %-*s ' "${colour:+"\033[1;31m"}" "${colour:+"\033[m"}" \ + printf '%b->%b %-*s ' "${color:+"\033[1;31m"}" "${color:+"\033[m"}" \ "$max" "${path#*/kiss-}" sed -n 's/^# *//;2p' "$(command -v "kiss-$path")" done | sort -uk1 >&2 @@ -1604,15 +1604,15 @@ main() { "${log_dir:=$cac_dir/logs}" \ "${bin_dir:=$cac_dir/bin}" - # Disable colour escape sequences if running in a subshell. - # This behaviour can be changed by adding a KISS_COLOUR + # Disable color escape sequences if running in a subshell. + # This behaviour can be changed by adding a KISS_COLOR # variable to the environment. If it is set to 1 it will - # always enable colour escapes, and if set to 0 it will - # always disable colour escapes. - if [ "$KISS_COLOUR" = 1 ]; then colour=1 - elif [ "$KISS_COLOUR" = 0 ] || ! [ -t 1 ]; then + # always enable color escapes, and if set to 0 it will + # always disable color escapes. + if [ "$KISS_COLOR" = 1 ]; then color=1 + elif [ "$KISS_COLOR" = 0 ] || ! [ -t 1 ]; then log() { printf '%s %s %s\n' "${3:-->}" "$1" "$2" >&2 ;} - else colour=1 + else color=1 fi args "$@" diff --git a/man/kiss.1 b/man/kiss.1 @@ -178,12 +178,12 @@ export KISS_TMPDIR= .SS ENABLING/DISABLING COLOUR If run in a subshell, \fBKISS\fR disables colour output. However, this behaviour -can be overriden. If a user defines a \fIKISS_COLOUR\fR environment value, it will +can be overriden. If a user defines a \fIKISS_COLOR\fR environment value, it will be enabled or disabled globally .IP -export KISS_COLOUR=1 # Enables globally +export KISS_COLOR=1 # Enables globally .IP -export KISS_COLOUR=0 # Disables globally +export KISS_COLOR=0 # Disables globally .PP .SS DISABLING PROMPTS User can disable prompts by setting a \fIKISS_NOPROMPT\fR environment value. This