Skip to content

Instantly share code, notes, and snippets.

@pdobb
Created May 25, 2023 05:13
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 pdobb/01a5f81af340d2c37a818cfee77d0d40 to your computer and use it in GitHub Desktop.
Save pdobb/01a5f81af340d2c37a818cfee77d0d40 to your computer and use it in GitHub Desktop.
Open reek Docs for SmellName from ZSH Shell
# 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