Permalink
Browse files

Cleaning up display()

  • Loading branch information...
1 parent 4a53bf1 commit 08c85cd7bb10f411de0f57582c241daefd0e0d24 @bahamas10 committed May 25, 2012
Showing with 10 additions and 11 deletions.
  1. +10 −11 bin/mad
View
21 bin/mad
@@ -88,17 +88,16 @@ display_file() {
local strong=$(get strong)
local em=$(get em)
- cat $1 \
- | perl -pe "
- s|^#+ *(.+)|\e[$heading\1\e[0m|g; \
- s|\`(.+?)\`|\e[$code\1\e[0m|g; \
- s|\*\*(.+?)\*\*|\e[$strong\1\e[0m|g; \
- s|__(.+?)__|\e[$strong\1\e[0m|g; \
- s|\*(.+?)\*|\e[$em\1\e[0m|g; \
- s|_(.+?)_|\e[$em\1\e[0m|g; \
- s| (.+)| \e[$code\1\e[0m|g; \
- s|<(.+?)>||g; \
- s|^| |;" \
+ < "$1" perl -pe "
+ s|^#+ *(.+)|\e[$heading\1\e[0m|g; \
+ s|\`(.+?)\`|\e[$code\1\e[0m|g; \
+ s|\*\*(.+?)\*\*|\e[$strong\1\e[0m|g; \
+ s|__(.+?)__|\e[$strong\1\e[0m|g; \
+ s|\*(.+?)\*|\e[$em\1\e[0m|g; \
+ s|_(.+?)_|\e[$em\1\e[0m|g; \
+ s| (.+)| \e[$code\1\e[0m|g; \
+ s|<(.+?)>||g; \
+ s|^| |;" \
| "$PAGER" -R
exit
}

0 comments on commit 08c85cd

Please sign in to comment.