mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Better error message for rbenv shell
Shell integration is not enabled by default. This means that, from all the commands from `rbenv commands`, only "shell" won't work right away. Replace "no such command" with a more descriptive message that points to `rbenv init` instead.
This commit is contained in:
parent
6aa70b6541
commit
af53c790cc
1 changed files with 7 additions and 1 deletions
|
@ -106,7 +106,13 @@ case "$command" in
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
command_path="$(command -v "rbenv-$command" || true)"
|
command_path="$(command -v "rbenv-$command" || true)"
|
||||||
[ -n "$command_path" ] || abort "no such command \`$command'"
|
if [ -z "$command_path" ]; then
|
||||||
|
if [ "$command" == "shell" ]; then
|
||||||
|
abort "shell integration not enabled. Run \`rbenv init' for instructions."
|
||||||
|
else
|
||||||
|
abort "no such command \`$command'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
shift 1
|
shift 1
|
||||||
if [ "$1" = --help ]; then
|
if [ "$1" = --help ]; then
|
||||||
|
|
Loading…
Reference in a new issue