Permalink
Browse files

Merge branch 'master' of github.com:visionmedia/mad

  • Loading branch information...
2 parents 726f3f5 + d89394f commit f458c0c4984b1fb8dd2ac362be2868d321417944 @tj committed Apr 19, 2012
Showing with 10 additions and 9 deletions.
  1. +10 −9 bin/mad
View
19 bin/mad
@@ -33,14 +33,15 @@ display() {
display_file() {
cat $1 \
- | perl -pe 's|^#+ *(.+)|\e[1m\1\e[0m|g' \
- | perl -pe 's|`(.+?)`|\e[90m\1\e[0m|g' \
- | perl -pe 's|\*\*(.+?)\*\*|\e[1m\1\e[0m|g' \
- | perl -pe 's|__(.+?)__|\e[1m\1\e[0m|g' \
- | perl -pe 's|\*(.+?)\*|\e[4m\1\e[0m|g' \
- | perl -pe 's|_(.+?)_|\e[4m\1\e[0m|g' \
- | perl -pe 's| (.+)| \e[90m\1\e[0m|g' \
- | perl -pe 's|^| |' \
+ | perl -pe '
+ s|^#+ *(.+)|\e[1m\1\e[0m|g; \
+ s|`(.+?)`|\e[90m\1\e[0m|g; \
+ s|\*\*(.+?)\*\*|\e[1m\1\e[0m|g; \
+ s|__(.+?)__|\e[1m\1\e[0m|g; \
+ s|\*(.+?)\*|\e[4m\1\e[0m|g; \
+ s|_(.+?)_|\e[4m\1\e[0m|g; \
+ s| (.+)| \e[90m\1\e[0m|g; \
+ s|^| |;' \
| less -R
exit
}
@@ -92,4 +93,4 @@ case $1 in
*)
display $1
;;
-esac
+esac

0 comments on commit f458c0c

Please sign in to comment.