Last active
September 16, 2024 14:44
-
-
Save MichaelDimmitt/2bb02d435a0ddbe2509a4cfef0fdfbe1 to your computer and use it in GitHub Desktop.
Find the correct help function on command line.
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
function hhelp() { | |
help $1 > /dev/null 2>&1 && echo "yes, help $1" || echo "no, help $1" ; | |
man $1 > /dev/null 2>&1 && echo "yes, man $1" || echo "no, man $1"; | |
$1 --help > /dev/null 2>&1 && echo "yes, $1 --help" || echo "no, $1 --help"; | |
$1 -h > /dev/null 2>&1 && echo "yes, $1 -h" || echo "no, $1 -h"; | |
apropos $1 > /dev/null 2>&1 && echo "yes, apropos $1" || echo "no, apropos $1"; | |
whatis $1 > /dev/null 2>&1 && echo "yes, whatis $1" || echo "no, whatis $1"; | |
which $1 > /dev/null 2>&1 && echo "yes, which $1" || echo "no, which $1"; | |
} | |
# because sometimes it is hard to find the correct help function on command line. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add tldr + a check to see if tldr exists before showing it now.