Skip to content

Instantly share code, notes, and snippets.

@gMan1990
Last active September 22, 2019 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gMan1990/89def2f171aca91fa37ed482a60eae21 to your computer and use it in GitHub Desktop.
Save gMan1990/89def2f171aca91fa37ed482a60eae21 to your computer and use it in GitHub Desktop.
$cmd --help; man "$cmd"|col -b
# 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