Skip to content
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

Bash Autocompletion Generator #69

Merged
merged 2 commits into from
Apr 11, 2015
Merged

Conversation

eparis
Copy link
Collaborator

@eparis eparis commented Mar 16, 2015

That's right. A golang program the writes a bash program!

@eparis
Copy link
Collaborator Author

eparis commented Mar 16, 2015

Requires spf13/pflag#8 before this will build

@eparis eparis force-pushed the command-annotations branch 4 times, most recently from 94e3bc2 to 9d6aada Compare March 17, 2015 23:53
eparis added a commit to eparis/kubernetes that referenced this pull request Mar 18, 2015
This autocompletion code was developed using:

spf13/cobra#69

Once that actually lands, we can autogenerate and make sure it never
gets out of date!
@eparis
Copy link
Collaborator Author

eparis commented Apr 6, 2015

I pulled out annotations and hard coded a new "ValidArgs" field. We don't really validate them, but we certainly could...

@eparis
Copy link
Collaborator Author

eparis commented Apr 6, 2015

@fabianofranz
Copy link
Contributor

@eparis Add README docs about how to use it.

Given a (potentially annotated) cobra command you can generate a bash
completion script.
@eparis
Copy link
Collaborator Author

eparis commented Apr 8, 2015

Now with 55% more README and 32% more tests!

@anthonyfok anthonyfok added the kind/feature A feature request for cobra; new or enhanced behavior label Apr 10, 2015
@fabianofranz
Copy link
Contributor

Very nice! I could think of a better integration of ValidArgs (auto validation of the number of args, receive pointers the same way flags do, etc); but those could be enhancements. Looks good for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A feature request for cobra; new or enhanced behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants