diff options
Diffstat (limited to 'workman.sh')
-rw-r--r-- | workman.sh | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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 |