本文整理匯總了Golang中github.com/GoogleCloudPlatform/kubernetes/pkg/util.StringFlag.Default方法的典型用法代碼示例。如果您正苦於以下問題:Golang StringFlag.Default方法的具體用法?Golang StringFlag.Default怎麽用?Golang StringFlag.Default使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/GoogleCloudPlatform/kubernetes/pkg/util.StringFlag
的用法示例。
在下文中一共展示了StringFlag.Default方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewCmdStartBuild
// NewCmdStartBuild implements the OpenShift cli start-build command
func NewCmdStartBuild(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
webhooks := util.StringFlag{}
webhooks.Default("none")
cmd := &cobra.Command{
Use: "start-build (BUILDCONFIG | --from-build=BUILD)",
Short: "Starts a new build",
Long: startBuildLong,
Example: fmt.Sprintf(startBuildExample, fullName),
Run: func(cmd *cobra.Command, args []string) {
err := RunStartBuild(f, out, cmd, args, webhooks)
cmdutil.CheckErr(err)
},
}
cmd.Flags().String("from-build", "", "Specify the name of a build which should be re-run")
cmd.Flags().Bool("follow", false, "Start a build and watch its logs until it completes or fails")
cmd.Flags().Var(&webhooks, "list-webhooks", "List the webhooks for the specified BuildConfig or build; accepts 'all', 'generic', or 'github'")
cmd.Flags().String("from-webhook", "", "Specify a webhook URL for an existing BuildConfign to trigger")
cmd.Flags().String("git-post-receive", "", "The contents of the post-receive hook to trigger a build")
cmd.Flags().String("git-repository", "", "The path to the git repository for post-receive; defaults to the current directory")
return cmd
}