about summary refs log tree commit diff stats
path: root/bash/man.bash
diff options
context:
space:
mode:
authorCase Duckworth2021-08-23 23:07:31 -0500
committerCase Duckworth2021-08-23 23:07:31 -0500
commite292eb508413b9174684a8e75c93474a7f5351ee (patch)
treee7e59b21c817bfd1c438ef3cfc68b9021e786d7c /bash/man.bash
downloadetc-e292eb508413b9174684a8e75c93474a7f5351ee.tar.gz
etc-e292eb508413b9174684a8e75c93474a7f5351ee.zip
Initial
Diffstat (limited to 'bash/man.bash')
-rw-r--r--bash/man.bash9
1 files changed, 9 insertions, 0 deletions
diff --git a/bash/man.bash b/bash/man.bash new file mode 100644 index 0000000..4927952 --- /dev/null +++ b/bash/man.bash
@@ -0,0 +1,9 @@
1export MANWIDTH=80
2
3# on smaller terminals, use their width
4# (cf. https://wiki.archlinux.org/index.php/Man_page#Page_width)
5man() {
6 local width=$(tput cols)
7 [ $width -gt $MANWIDTH ] && width=$MANWIDTH
8 env MANWIDTH=$width man "$@"
9}