mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-17 01:55:10 +00:00
FIX --no-color works again (see #78 )
now _msg complies with zsh way of doing colors
This commit is contained in:
parent
1af4c42749
commit
b07c8ae67c
19
src/tomb
19
src/tomb
@ -51,8 +51,8 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
|
|
||||||
function _msg() {
|
function _msg() {
|
||||||
local command="print -P"
|
local command="print -P"
|
||||||
local progname="%{%F{magenta}%}${TOMBEXEC##*/}%{%f%}"
|
local progname="$fg[magenta]${TOMBEXEC##*/}$fg[reset_color]"
|
||||||
local message="%{%F{normal}%}${2}%{%f%}"
|
local message="$fg_bold[normal]$fg_no_bold[normal]${2}$fg[reset_color]"
|
||||||
local -i returncode
|
local -i returncode
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -60,19 +60,19 @@ function _msg() {
|
|||||||
command+=" -n"; pchars=" > "; pcolor="yellow"
|
command+=" -n"; pchars=" > "; pcolor="yellow"
|
||||||
;;
|
;;
|
||||||
message)
|
message)
|
||||||
pchars=" . "; pcolor="green"
|
pchars=" . "; pcolor="white"; message="$fg_no_bold[$pcolor]${2}$fg[reset_color]"
|
||||||
;;
|
;;
|
||||||
verbose)
|
verbose)
|
||||||
pchars="[D]"; pcolor="blue"
|
pchars="[D]"; pcolor="blue"
|
||||||
;;
|
;;
|
||||||
success)
|
success)
|
||||||
pchars="(*)"; pcolor="green"; message="%{%F{$pcolor}%}${2}%{%f%}"
|
pchars="(*)"; pcolor="green"; message="$fg_no_bold[$pcolor]${2}$fg[reset_color]"
|
||||||
;;
|
;;
|
||||||
warning)
|
warning)
|
||||||
pchars="[W]"; pcolor="yellow"; message="%{%F{$pcolor}%}${2}%{%f%}"
|
pchars="[W]"; pcolor="yellow"; message="$fg_no_bold[$pcolor]${2}$fg[reset_color]"
|
||||||
;;
|
;;
|
||||||
failure)
|
failure)
|
||||||
pchars="[E]"; pcolor="red"; message="%{%F{$pcolor}%}${2}%{%f%}"
|
pchars="[E]"; pcolor="red"; message="$fg_no_bold[$pcolor]${2}$fg[reset_color]"
|
||||||
returncode=1
|
returncode=1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -81,7 +81,7 @@ function _msg() {
|
|||||||
returncode=127
|
returncode=127
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
${=command} "${progname} %{%B%F{$pcolor}%}$pchars%{%f%b%} ${message}"
|
${=command} "${progname} $fg_bold[$pcolor]$pchars$fg[reset_color] ${message}$color[reset_color]"
|
||||||
return $returncode
|
return $returncode
|
||||||
}
|
}
|
||||||
function _message say()
|
function _message say()
|
||||||
@ -1353,11 +1353,6 @@ list_tombs() {
|
|||||||
print -n "$fg_no_bold[white] using "
|
print -n "$fg_no_bold[white] using "
|
||||||
print "$fg_bold[white]$tombfs $tombfsopts"
|
print "$fg_bold[white]$tombfs $tombfsopts"
|
||||||
|
|
||||||
print -n "$fg_no_bold[green]$tombname"
|
|
||||||
print -n "$fg_no_bold[white] cipher ${tombstat}"
|
|
||||||
print -n "keysize $tombstat[1]"
|
|
||||||
print "mounted via $tombstat[2]"
|
|
||||||
|
|
||||||
print -n "$fg_no_bold[green]$tombname"
|
print -n "$fg_no_bold[green]$tombname"
|
||||||
print -n "$fg_no_bold[white] open since "
|
print -n "$fg_no_bold[white] open since "
|
||||||
print "$fg_bold[white]$tombsince$fg_no_bold[white]"
|
print "$fg_bold[white]$tombsince$fg_no_bold[white]"
|
||||||
|
Loading…
Reference in New Issue
Block a user