Permalink
Browse files

merge

  • Loading branch information...
2 parents 2d2a1d5 + 70a1bef commit 8964f10630bd9ed29679cbf7bf8279b84f07fe9e @tj committed Apr 19, 2012
Showing with 22 additions and 2 deletions.
  1. +2 −1 Readme.md
  2. +18 −0 bin/mad
  3. +2 −1 share/mad/mad.md
View
@@ -15,8 +15,9 @@
-U, --update-self update mad(1) itself
-u, --update update remote mad-pages
- -V, --version output cpm version
+ -v, --version output cpm version
-h, --help output this help information
+ -l, --list list mad-pages
## Installation
View
18 bin/mad
@@ -6,6 +6,22 @@ REMOTE_MAD=git@github.com:visionmedia/mad.git
CONFIG=$(dirname $0)/../etc/mad.conf
MAD_CONFIG=${MAD_CONFIG:-$CONFIG}
+#
+# List all <pages>
+#
+
+list_pages() {
+ IFS=":"
+ local paths="$MAD_PATH:/usr/local/share/mad:/usr/share/mad"
+
+ echo
+ echo -e " \033[1mmad pages\033[0m"
+ echo
+ for path in $paths; do
+ test ! -z $path && test -d $path && find $path -type f -print0 | xargs -0 basename | grep -iv 'readme*' | grep '.md$' | perl -pe 's|^(.*)\.md$| \1|;'
+ done
+}
+
#
# Display <page> with lookup via MAD_PATH.
#
@@ -122,6 +138,8 @@ case $1 in
;;
-U|--update-self)
install_mad
+ -l|--list)
+ list_pages
;;
*)
display $1
View
@@ -13,8 +13,9 @@
-U, --update-self update mad(1) itself
-u, --update update remote mad-pages
- -V, --version output mad version
+ -v, --version output mad version
-h, --help output this help information
+ -l, --list list mad-pages
## Installation

0 comments on commit 8964f10

Please sign in to comment.