Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added stdin support

  • Loading branch information...
commit cae36b2b4e4e2021d0047bee7d3448d53f3536a5 1 parent 0149bf8
@tj authored
Showing with 13 additions and 1 deletion.
  1. +11 −0 bin/mad
  2. +2 −1  share/mad/mad.md
View
11 bin/mad
@@ -56,6 +56,14 @@ get() {
}
#
+# Display from stdin.
+#
+
+display_from_stdin() {
+ display_file <(cat)
+}
+
+#
# Display <file>
#
@@ -143,6 +151,9 @@ case $1 in
-l|--list|ls|list)
list_pages
;;
+ -)
+ display_from_stdin
+ ;;
*)
display $1
;;
View
3  share/mad/mad.md
@@ -15,7 +15,8 @@
-u, --update update remote mad-pages
-v, --version output mad version
-h, --help output this help information
- -l, --list list mad-pages
+ -l, --list list mad-pages
+ - read from stdin
## Installation
Please sign in to comment.
Something went wrong with that request. Please try again.