mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Colorize zpool status output
If the ZFS_COLOR env variable is set, then use ANSI color output in zpool status: - Column headers are bold - Degraded or offline pools/vdevs are yellow - Non-zero error counters and faulted vdevs/pools are red - The 'status:' and 'action:' sections are yellow if they're displaying a warning. This also includes a new 'faketty' function in libtest.shlib that is compatible with FreeBSD (code provided by @freqlabs). Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes #9340
This commit is contained in:
committed by
Brian Behlendorf
parent
5e8ac05590
commit
9fb2771aa5
@@ -77,6 +77,7 @@ export SYSTEM_FILES_COMMON='arp
|
||||
rm
|
||||
rmdir
|
||||
scp
|
||||
script
|
||||
sed
|
||||
seq
|
||||
setfacl
|
||||
|
||||
@@ -3916,3 +3916,18 @@ function stat_size #<path>
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Run a command as if it was being run in a TTY.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# faketty command
|
||||
#
|
||||
function faketty
|
||||
{
|
||||
if is_freebsd; then
|
||||
script -q /dev/null "$@"
|
||||
else
|
||||
script --return --quiet -c "$*" /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user