Skip to content

Commit

Permalink
Added
Browse files Browse the repository at this point in the history
  Failed to locate '--update'

    MAD_PATH=":/usr/local/share/mad:/usr/share/mad:." for remote pages
  • Loading branch information
tj committed Apr 15, 2012
1 parent 136b30c commit 0ee8a69
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Readme.md
Expand Up @@ -13,6 +13,7 @@


Options: Options:


-u, --update update remote mad-pages
-V, --version output cpm version -V, --version output cpm version
-h, --help output this help information -h, --help output this help information


Expand All @@ -37,6 +38,12 @@
`mad(1)` pipes to `less(1)` so you get the same paging / searching `mad(1)` pipes to `less(1)` so you get the same paging / searching
goodness that you expect from `man(1)`. goodness that you expect from `man(1)`.


## Page repository

[mad-pages](https://github.com/visionmedia/mad-pages) is a collection of
useful mad pages such as language operator precedence tables, http status
codes, mime type tables etc.

## Page lookup ## Page lookup


Use the __MAD_PATH__ environment variable to control Use the __MAD_PATH__ environment variable to control
Expand Down
21 changes: 21 additions & 0 deletions bin/mad
@@ -1,6 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash


VERSION="0.1.0" VERSION="0.1.0"
REMOTE=git@github.com:visionmedia/mad-pages.git


# #
# Display <page> with lookup via MAD_PATH. # Display <page> with lookup via MAD_PATH.
Expand Down Expand Up @@ -53,6 +54,23 @@ display_mad_usage() {
exit exit
} }


#
# Install remote manuals.
#

install_all_remote() {
local path=/usr/local/share/mad
echo
echo " ... cloning repo"
cd /tmp
git clone --depth 1 $REMOTE mad-pages
cd mad-pages
for page in *.md; do
echo " ... installing $page"
cp -f $page $path/$page
done
}

# file required # file required


test $# -eq 0 && display_mad_usage test $# -eq 0 && display_mad_usage
Expand All @@ -66,6 +84,9 @@ case $1 in
-h|--help|help) -h|--help|help)
display_mad_usage display_mad_usage
;; ;;
-u|--update)
install_all_remote
;;
*) *)
display $1 display $1
;; ;;
Expand Down
1 change: 1 addition & 0 deletions share/mad/mad.md
Expand Up @@ -11,6 +11,7 @@


Options: Options:


-u, --update update remote mad-pages
-V, --version output mad version -V, --version output mad version
-h, --help output this help information -h, --help output this help information


Expand Down

0 comments on commit 0ee8a69

Please sign in to comment.