diff --git a/libexec/rbenv b/libexec/rbenv index 7be3eed7..609eda11 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -91,12 +91,18 @@ shopt -u nullglob command="$1" case "$command" in -"" | "-h" | "--help" ) - echo -e "$(rbenv---version)\n$(rbenv-help)" >&2 +"" ) + { rbenv---version + rbenv-help + } >&2 + exit 1 ;; -"-v" ) +-v ) exec rbenv---version ;; +-h | --help ) + exec rbenv-help + ;; * ) command_path="$(command -v "rbenv-$command" || true)" if [ -z "$command_path" ]; then diff --git a/test/rbenv.bats b/test/rbenv.bats index 4a6d1414..4e6b32b0 100644 --- a/test/rbenv.bats +++ b/test/rbenv.bats @@ -4,7 +4,7 @@ load test_helper @test "blank invocation" { run rbenv - assert_success + assert_failure assert_line 0 "$(rbenv---version)" }