1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-12 13:33:45 -05:00

add --help to subcommand completions

ensure subcommand exists, then include --help in its completion output
This commit is contained in:
Jason Karns
2015-11-17 15:01:33 -05:00
parent 2c4dd63f77
commit d7ca2aba2a
3 changed files with 12 additions and 2 deletions

View File

@@ -11,6 +11,10 @@ if [ -z "$COMMAND" ]; then
fi
COMMAND_PATH="$(command -v "rbenv-$COMMAND" || command -v "rbenv-sh-$COMMAND")"
# --help is provided automatically
echo --help
if grep -iE "^([#%]|--|//) provide rbenv completions" "$COMMAND_PATH" >/dev/null; then
shift
exec "$COMMAND_PATH" --complete "$@"