aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2022-12-09 19:16:16 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2022-12-09 19:16:16 +0100
commit9a1b50d542ec9000f62628a4e5ff3a5c53538ebb (patch)
tree55f5403b5a198142aa79787817770c0c1c101e38
parent02ff054e309fcab5d9149630b9635b7465fa179e (diff)
default to gray if @ is unknown
-rwxr-xr-xscrubs7
1 files changed, 2 insertions, 5 deletions
diff --git a/scrubs b/scrubs
index a62205b..a4b42ee 100755
--- a/scrubs
+++ b/scrubs
@@ -26,7 +26,7 @@ todos() {
sed -e "s/^\*\//\\\\033[2;3;39m$hborderbot\\\\033[0m\\\\n/g" | \
sed -e 's/^\*/ /g' | \
sed -E 's/@category (.*)/\\033[34m\1\\033[0m/g' | \
- sed -E 's/@description/\\033[2mdescription\\033[0m/g')\n"
+ sed -E 's/@([^ ]*)[ ]*(.*)/\\033[2m\1\\033[0m \\033[33m\2\\033[0m/g')\n"
}
get_docs() {
@@ -56,10 +56,7 @@ doc() {
sed -e 's/^\*/ /g' | \
sed -E 's/@type (.*)/\\033[32m\1\\033[0m/g' | \
sed -E 's/@name (.*)/\\033[34m\1\\033[0m/g' | \
- sed -E 's/@param (.*)/\\033[2mparam\\033[0m \\033[33m\1\\033[0m/g' | \
- sed -E 's/@inherit (.*)/\\033[2minherit from\\033[0m \\033[33m\1\\033[0m/g' | \
- sed -E 's/@return (.*)/\\033[2mreturn\\033[0m \\033[33m\1\\033[0m/g' | \
- sed -E 's/@description/\\033[2mdescription\\033[0m/g')
+ sed -E 's/@([^ ]*)[ ]*(.*)/\\033[2m\1\\033[0m \\033[33m\2\\033[0m/g')
if [ "$(printf "%s" "$output" | wc -l)" -eq 0 ]; then
printf "%s\n" "There is no documentation for '$1' '$2'"