Last active
July 15, 2021 06:10
-
-
Save SnapperGee/4591300ed71e9578b49c0253fa22c7b7 to your computer and use it in GitHub Desktop.
Bash script that opens man page with x-man-page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Xman v0.2 | |
# On macOS, opens x-man page in new window for scripts | |
# that have man pages. Otherwise attempt to open with | |
# default man command. | |
for argument in "$@"; do | |
# If man page exists open with x-man-page | |
if man "$argument" > /dev/null 2>&1 ; then | |
open x-man-page://"$argument" | |
# else attempt to open with default man page | |
else | |
man "$argument" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment