Created
May 25, 2023 05:13
-
-
Save pdobb/01a5f81af340d2c37a818cfee77d0d40 to your computer and use it in GitHub Desktop.
Open reek Docs for SmellName from ZSH Shell
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
# Open reek documentation for the given <SmellName>. | |
# | |
# Example: | |
# `reekd` -> Opens https://github.com/troessner/reek/tree/master/docs | |
# `reekd BooleanParameter` -> Opens https://github.com/troessner/reek/blob/master/docs/Boolean-Parameter.md | |
function reekd() { | |
if [[ $# -eq 0 ]]; then | |
open "https://github.com/troessner/reek/tree/master/docs" | |
else | |
local formatted_section=$(echo "$1" | sed 's/\([A-Z][a-z]\)/-\1/g' | sed 's/^-//') | |
open "https://github.com/troessner/reek/blob/master/docs/${formatted_section}.md" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment