From 2c4dd63f777ac2219dd21b806b1d422b897d64be Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Tue, 17 Nov 2015 14:51:10 -0500 Subject: [PATCH] handle --help for subcommands If subcommand is provided (and exists) and its first arg is -h/--help, go ahead and intercept the call; redirecting to rbenv-help This means subcommands and plugins need not handle --help flag themselves --- libexec/rbenv | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libexec/rbenv b/libexec/rbenv index b65ca112..a7c4cc5a 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -111,6 +111,10 @@ case "$command" in fi shift 1 - exec "$command_path" "$@" + if [ "$1" = --help ]; then + exec rbenv-help "$command" + else + exec "$command_path" "$@" + fi ;; esac