summaryrefslogtreecommitdiff
path: root/tz/workman.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tz/workman.sh')
-rw-r--r--tz/workman.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/tz/workman.sh b/tz/workman.sh
index 8fb18a4..6e2da3a 100644
--- a/tz/workman.sh
+++ b/tz/workman.sh
@@ -4,11 +4,13 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
-# Tell groff not to emit SGR escape sequences (ANSI color escapes).
-GROFF_NO_SGR=1
-export GROFF_NO_SGR
+if (type nroff && type perl) >/dev/null 2>&1; then
-echo ".am TH
+ # Tell groff not to emit SGR escape sequences (ANSI color escapes).
+ GROFF_NO_SGR=1
+ export GROFF_NO_SGR
+
+ echo ".am TH
.hy 0
.na
..
@@ -30,4 +32,10 @@ echo ".am TH
print "$_\n";
$didprint = 1;
}
-'
+ '
+elif (type mandoc && type col) >/dev/null 2>&1; then
+ mandoc -man -T ascii "$@" | col -bx
+else
+ echo >&2 "$0: please install nroff and perl, or mandoc and col"
+ exit 1
+fi