Use term formatter, if term

Fri, 15 Mar 2019 23:44:27 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 15 Mar 2019 23:44:27 -0500
changeset 743
76c4c96d8b9f
parent 742
354f9d473a4b
child 744
7a5823050d74

Use term formatter, if term

bin/perldoc file | annotate | diff | comparison | revisions
--- a/bin/perldoc
+++ b/bin/perldoc
@@ -1,6 +1,10 @@
 #!/bin/sh
 set -eu
 
+if [ -t 1 ]; then
+  export PERLDOC="-oterm ${PERLDOC:-}"
+fi
+
 if [ -x "$(command -v cpandoc)" ]; then
   exec cpandoc $*
 fi

mercurial