|
|
@ -110,9 +110,23 @@ print_help() { |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then |
|
|
|
|
|
rbenv---version |
|
|
|
|
|
|
|
|
print_usage() { |
|
|
|
|
|
local command="$1" |
|
|
|
|
|
local summary usage help |
|
|
|
|
|
eval "$(documentation_for "$command")" |
|
|
|
|
|
[ -z "$usage" ] || echo "$usage" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
unset usage |
|
|
|
|
|
if [ "$1" = "--usage" ]; then |
|
|
|
|
|
usage="1" |
|
|
|
|
|
shift |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$1" ] || [ "$1" == "rbenv" ]; then |
|
|
|
|
|
[ -n "$usage" ] || rbenv---version |
|
|
echo "Usage: rbenv <command> [<args>]" |
|
|
echo "Usage: rbenv <command> [<args>]" |
|
|
|
|
|
[ -z "$usage" ] || exit |
|
|
echo |
|
|
echo |
|
|
echo "Some useful rbenv commands are:" |
|
|
echo "Some useful rbenv commands are:" |
|
|
print_summaries commands rehash global local shell version versions which whence |
|
|
print_summaries commands rehash global local shell version versions which whence |
|
|
@ -122,7 +136,11 @@ if [ -z "$1" ]; then |
|
|
else |
|
|
else |
|
|
command="$1" |
|
|
command="$1" |
|
|
if [ -n "$(command_path "$command")" ]; then |
|
|
if [ -n "$(command_path "$command")" ]; then |
|
|
print_help "$command" |
|
|
|
|
|
|
|
|
if [ -n "$usage" ]; then |
|
|
|
|
|
print_usage "$command" |
|
|
|
|
|
else |
|
|
|
|
|
print_help "$command" |
|
|
|
|
|
fi |
|
|
else |
|
|
else |
|
|
echo "rbenv: no such command \`$command'" >&2 |
|
|
echo "rbenv: no such command \`$command'" >&2 |
|
|
exit 1 |
|
|
exit 1 |
|
|
|