Closed coreycarvalho closed 5 years ago
Hmmm. I can't see anythning obvious. What happens when you run your app with GLI_DEBUG=true
in the environment (e.g. GLI_DEBUG=true my_app subcommand foo
)?
There's a couple places where we default to autocomplete true, but I can't see where the value from autocomplete_commands
wouldn't fall through and set it to false.
👋I created a small example where autocomplete_commands false
fails for a sub command. Here's the repo: https://github.com/Root-App/gli-auto-complete.
With that code, running: GLI_DEBUG=true ./bin/gli_auto_complete parent chil
yields the following result:
09:22 $ GLI_DEBUG=true ./bin/gli_auto_complete parent chil
Using 'chil' as it's is short for child.
Set autocomplete false for any command you don't want matched like this
Running the child command
We're declaring the auto complete setting here. Maybe we have a misunderstanding of that setting. Is there anything else we need to configure to get the behavior we want?
If it helps, we're on GLI version 2.18.0
If this is indeed a bug, we'd be more than happy submit a PR
The way you are using it looks correct (assuming that you cannot autocomplete parent command)
So yeah, this seems like a bug and if you are game to tackle it, I'm game to merge your PR! :)
I'm unable to close this issue, but I think it can be closed now
oops, I got it.
Given a command with subcommands (ex.
command subcommand foobar
), andautocomplete_commands(false)
, only the first subcommand does not autocomplete.command sub
would throw an error.command subcommand foo
would autocomplete tocommand subcommand foobar
.I would expect
command subcommand foo
to also throw an error.