1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 13:16:44 +02:00

bug fix: language parser

This commit is contained in:
Your Name
2020-06-20 17:27:21 -04:00
parent fe0246be96
commit 3137761c34
+2 -2
View File
@@ -73,8 +73,8 @@ oeis() (
then
# Print out code sample for specified language
grep '%o' $DOC \
| sed "s/^.*${ID} //" \
| awk -v tgt="${LANGUAGE^^}" -F'[()]' '{act=$2} sub(/^\([^()]+\) */,""){f=(tgt==toupper(act))} f' ${TMP}/prog \
| sed "s/%o ${ID} //" \
| awk -v tgt="${LANGUAGE^^}" -F'[()]' '{act=$2} sub(/^\([^()]+\) */,""){f=(tgt==toupper(act))} f' \
> ${TMP}/code_snippet
fi
# Print code snippet with 4-space indent to enable colorization