GoogleCloudPlatform/kubernetes — pull request #2437 by deads2k (2014-11-18 14:06:35+00:00)
Title: add utility for binding flags and building api server clients

This utility provides one stop shopping for a command line executable to get bind the correct flags, build the client config, and create a working client. The code for usage reduces to something like this:
authLoader := &PromptingAuthLoader{os.Stdin}
clientBuilder := clientcmd.NewClientBuilder(authLoader)
clientBuilder.BindFlags(cmds.PersistentFlags())
apiClient, err := clientBuilder.BuildClient()
I made the flags congruent with kubectl and used kubectl as an example spot for usage. This makes use of the auth config work in #2340 and the Bind and Build approach could be used to unify client creation and flag names.

@smarterclayton You've had an interest in this area.