Skip to content

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 eparis force-pushed the command-annotations branch from 9d6aada to a3cd8ac Compare March 18, 2015 18:32
@eparis eparis force-pushed the command-annotations branch from a3cd8ac to fb50344 Compare April 6, 2015 23:35
@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.

eparis added 2 commits April 7, 2015 20:13
Given a (potentially annotated) cobra command you can generate a bash
completion script.
@eparis eparis force-pushed the command-annotations branch from fb50344 to a068307 Compare April 8, 2015 00:35
@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