sstephenson/rbenv — pull request #292 by mislav (2012-12-13 04:52:49+00:00)
Title: help system where each command holds its own docs

I've extracted this from Coral, which was in turn inspired by
37signals/sub.

Docs are comprised from "Usage", "Summary" and "Help" sections, where
"Help" can span multiple commented lines. If it is missing, "Summary" is shown
in its place.

/cc @sstephenson @cldwalker

Example: `rbenv which`

~~~ sh
set -e
~~~

The way it displays usage line on STDERR when invoked incorrectly:

~~~ sh
RBENV_COMMAND="$1"

if [ -z "$RBENV_COMMAND" ]; then
rbenv-help which | head -1 >&2
exit 1
fi
~~~