Explorar el Código

Add `rbenv help --usage`

pull/360/head^2
Sam Stephenson hace 13 años
padre
commit
e2e474c59d
Se han modificado 3 ficheros con 23 adiciones y 5 borrados
  1. +21
    -3
      libexec/rbenv-help
  2. +1
    -1
      libexec/rbenv-whence
  3. +1
    -1
      libexec/rbenv-which

+ 21
- 3
libexec/rbenv-help Ver fichero

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

+ 1
- 1
libexec/rbenv-whence Ver fichero

@ -30,7 +30,7 @@ whence() {
RBENV_COMMAND="$1"
if [ -z "$RBENV_COMMAND" ]; then
rbenv-help whence | head -1 >&2
rbenv-help --usage whence >&2
exit 1
fi

+ 1
- 1
libexec/rbenv-which Ver fichero

@ -52,7 +52,7 @@ RBENV_VERSION="$(rbenv-version-name)"
RBENV_COMMAND="$1"
if [ -z "$RBENV_COMMAND" ]; then
rbenv-help which | head -1 >&2
rbenv-help --usage which >&2
exit 1
fi

Cargando…
Cancelar
Guardar