Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Apr 19, 2012
2 parents 2d2a1d5 + 70a1bef commit 8964f10
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Readme.md
Expand Up @@ -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

Expand Down
18 changes: 18 additions & 0 deletions bin/mad
Expand Up @@ -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.
#
Expand Down Expand Up @@ -122,6 +138,8 @@ case $1 in
;;
-U|--update-self)
install_mad
-l|--list)
list_pages
;;
*)
display $1
Expand Down
3 changes: 2 additions & 1 deletion share/mad/mad.md
Expand Up @@ -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

Expand Down

0 comments on commit 8964f10

Please sign in to comment.