Created
June 8, 2014 05:56
-
-
Save anekos/0c8986e748218f535631 to your computer and use it in GitHub Desktop.
refe-color: Ruby の refe コマンドの出力に色つけたりする
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
#!/bin/bash | |
VAL_m='1' | |
VAL_header='1;4' | |
VAL_at='1;34' | |
VAL_quote='44' | |
sed_pattern=`printf ' | |
s/\[\[m:/\[%sm/g ; | |
s/\]\]/\[0m/g ; | |
s/^\* \(.*\)$/\[%sm\\\\1[0m/g ; | |
s/^@\([^ ]*\)/\[%sm\\\\1[0m/g ; | |
s/^\--- \(.*\)$/ \[%sm\\\\1[0m/g ; | |
' "$VAL_m" "$VAL_header" "$VAL_at" "$VAL_quote"` | |
function filter { | |
sed "$sed_pattern" | |
} | |
refe "$@" | filter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment