Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/data/data/com.termux/files/usr/bin/bash
- ####
- # Author: Paul Thiong'o <thioshp@outlook.com>
- # Created on: Tue, 15 Oct 2019 2047
- # Machine used: Termux on iTel
- # Purpose: Prettify the display of a man page by piping to `col` then to the `bat` pager.
- #
- ####
- # Variables
- pname=`basename "$0"`
- usage="$pname is used to prettify a manual page using bat.\n"
- syntax="$pname <COMMAND>\n"
- errormsg="ERROR: $pname will exit because you didn't give a command whose man page you wish to view.\n"
- # Exit on less than 1 args
- if [ $# -lt 1 ];
- then
- echo -e "$errormsg";
- echo -e "$usage";
- echo -e "$syntax";
- shift;
- else
- # Pipe man's output thru `col` then pipe to `bat` pager
- man "$1" | col -bx | bat --language man
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement