bash completion generated by cobra does not work correctly for alias of command.
$ bash --version
GNU bash, version 4.4.12(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ source $(brew --prefix)/share/bash-completion/bash_completion
$ source <(hello completion)
$ alias h="hello"
$ complete -o default -F __start_hello h
$ h <tab>
Actual output:
$ h <tab>
hello
Expected output:
$ h <tab>
completion say
https://github.com/superbrothers-sandbox/hello-cli/tree/autocomplete-alias reproduces this issue.
@superbrothers Looks like this can be closed and is fixed.
@nikhita Yes, this has been already fixed by https://github.com/spf13/cobra/pull/638. Thank you for letting me know.
Most helpful comment
@nikhita Yes, this has been already fixed by https://github.com/spf13/cobra/pull/638. Thank you for letting me know.