Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merge

  • Loading branch information...
commit 8964f10630bd9ed29679cbf7bf8279b84f07fe9e 2 parents 2d2a1d5 + 70a1bef
@tj authored
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
3  Readme.md
@@ -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
@@ -7,6 +7,22 @@ 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
3  share/mad/mad.md
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.