1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-12 21:33:54 -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

@@ -13,7 +13,7 @@ create_command() {
create_command "rbenv-hello" "#!$BASH
echo hello"
run rbenv-completions hello
assert_success ""
assert_success "--help"
}
@test "command with completion support" {
@@ -25,7 +25,11 @@ else
exit 1
fi"
run rbenv-completions hello
assert_success "hello"
assert_success
assert_output <<OUT
--help
hello
OUT
}
@test "forwards extra arguments" {
@@ -40,6 +44,7 @@ fi"
run rbenv-completions hello happy world
assert_success
assert_output <<OUT
--help
happy
world
OUT

View File

@@ -35,6 +35,7 @@ create_executable() {
run rbenv-completions exec
assert_success
assert_output <<OUT
--help
rake
ruby
OUT