-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add fish completion support #754
add fish completion support #754
Conversation
It seems that there is a difference of opinion between gofmt in the go-current tests and go-latest. |
bump |
It would be lovely to see this merged, so that kubernetes/kubectl#131 can be addressed. |
@eparis could you take a look at this? |
2aa324a
to
875c5ee
Compare
Sorry for the noise, but @0robustus1 are you going to finish this off? |
Hi @davewongillies. AFAIK there aren't any action items that would need to be completed. As far as i am concerned this waiting for interaction with the PR by a maintainer, e.g. regarding review or guidance how to proceed with the test-suite (e.g. updating go-current, *-latest and *-previous references). I as well as others have tried reaching the maintainers, but we haven't heard anything so far. |
@0robustus1 so it looks like #737 got merged in earlier in the year, which probably handles the test for go-current failing. I rebased your branch from master in my own fork, reverted your last commit 875c5ee, then created a draft PR and all the tests pass: #865 https://circleci.com/gh/spf13/cobra/1259 |
With the old version flags between subcommands weren't allowed (as it was doing exact match). This solution is still not perfect (as it uses '.+') and could potentially swallow other subcommands.
875c5ee
to
64400ad
Compare
@davewongillies thx, i hadn't noticed that this particular PR got merged. I performed the rebase. |
Any chance of this getting merged? |
So far, I tried this PR by compiling GoogleContainerTools/skaffold with the patched spf13/cobra, and it produced a working completion. Then I put the generated competition in my dotfiles. It's a PITA but it works. I wish it was accepted sooner so the dependents could pick up the new API. |
As of yesterday this Pull-Request is officially 1 year old (Happy Birthday btw. 🎉 ). I'll therefore give this one more try: |
@0robustus1, I feel it pertinent to ref #959 here. |
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
any plans to merge this? |
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
* add fish completion basics to cobra. * add helpCommand check to fish completions. * add basic tests for fish completion. * support ValidArgs completion of commands in fish. * add additional support for argument aliases. * remove oly mention. * use custom function for checking subcommand path. * use fish builtin for flag/argument checking. * backport __fish_seen_argument. * escape description of commands & flags. * allow subcommand_path to match even with flags * deal with unreachable code warning.
Seems like #1048 may be replacing this. |
#1048 is merged |
Great! This can be closed now. |
This adds generation of fish autocompletion as suggested in #350.
It should support the following types of completion:
ValidArgs
andArgAliases
)@JHK tested the completion by integrating it with kubectl. We are planning to integrate fish completion with kubectl after it is available in cobra.