Last active
September 22, 2019 05:56
-
-
Save gMan1990/89def2f171aca91fa37ed482a60eae21 to your computer and use it in GitHub Desktop.
$cmd --help; man "$cmd"|col -b
This file contains hidden or 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
# https://fishshell.com/docs/current/tutorial.html#tut_autoload | |
function _man | |
if type "$argv[1]" >/dev/null | |
if type "$argv[1]" | grep -m 1 " is a function with definition\$" >/dev/null | |
type "$argv[1]" >&2 | |
else | |
if test "nginx" = "$argv[1]" | |
"$argv[1]" -h 2>&1; echo -e "\n" | |
else if test "echo" != "$argv[1]" | |
"$argv[1]" --help 2>&1; echo -e "\n" | |
end | |
man "$argv[1]" 2>&1 | col -b | |
end | |
else | |
man "$argv[1]" 2>&1 | col -b | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment