diff options
author | Case Duckworth | 2021-08-23 23:07:31 -0500 |
---|---|---|
committer | Case Duckworth | 2021-08-23 23:07:31 -0500 |
commit | e292eb508413b9174684a8e75c93474a7f5351ee (patch) | |
tree | e7e59b21c817bfd1c438ef3cfc68b9021e786d7c /bash/man.bash | |
download | etc-e292eb508413b9174684a8e75c93474a7f5351ee.tar.gz etc-e292eb508413b9174684a8e75c93474a7f5351ee.zip |
Initial
Diffstat (limited to 'bash/man.bash')
-rw-r--r-- | bash/man.bash | 9 |
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 @@ | |||
1 | export MANWIDTH=80 | ||
2 | |||
3 | # on smaller terminals, use their width | ||
4 | # (cf. https://wiki.archlinux.org/index.php/Man_page#Page_width) | ||
5 | man() { | ||
6 | local width=$(tput cols) | ||
7 | [ $width -gt $MANWIDTH ] && width=$MANWIDTH | ||
8 | env MANWIDTH=$width man "$@" | ||
9 | } | ||