I've followed the docs here to enable bash completion on my machine with no success.
main.go: app.EnableBashCompletion = true./usr/local/bin directory. Running mycli somecommand someargument works fine.mycli followed by the tab key produces results for the files inside my current directory, not subcommands.go.mod includes github.com/urfave/cli v1.22.3.PROG=mycli source zsh_autocomplete anywhere (assuming zsh_autocomplete is in the current directory)?This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.
I'm still interested in this issue's resolution.
This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.
@joebateh for bash completion i did:
sudo wget -O /etc/bash_completion.d/tea https://raw.githubusercontent.com/urfave/cli/master/autocomplete/bash_autocomplete && sudo chmod +x /etc/bash_completion.d/tea
Hey @6543, I gave that a shot on both MacOS and Ubuntu with no success. I'm still getting directories instead of autocomplete suggestions.
:point_up: you have to replace tea with the name of your command - but I guess you did
what is returned when you do ./your-tool --generate-bash-completion?
I tried running the command below:
sudo wget -O /etc/bash_completion.d/mycli https://raw.githubusercontent.com/urfave/cli/master/autocomplete/bash_autocomplete && sudo chmod +x /etc/bash_completion.d/mycli
Then I typed mycli followed by pressing the tab character. It still shows up with the local directory as opposed to autocompletion.
If I type mycli --generate-bash-completion I see the set of subcommands for any given command, so it seems like whatever logic generates that _can_ do it. It's just not saving or pulling it in somewhere else.
Is there anything basic I might be missing?
do you have [ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion in youe ~/.bashrc ?
It wasn't there, but I added it with no success.
ok at this point I also have no idear ...