// Unlike most Go programs, the `Main()` function will not be used to run all of the // commands provided in your plugin. Main will be used to initialize the plugin // process, as well as any dependencies you might require for your // plugin. func main() { // Any initialization for your plugin can be handled here // // Note: to run the plugin.Start method, we pass in a pointer to the struct // implementing the interface defined at "code.cloudfoundry.org/cli/plugin/plugin.go" // // Note: The plugin's main() method is invoked at install time to collect // metadata. The plugin will exit 0 and the Run([]string) method will not be // invoked. plugin.Start(new(BasicPlugin)) // Plugin code should be written in the Run([]string) method, // ensuring the plugin environment is bootstrapped. }
func main() { // T needs to point to a translate func, otherwise cf internals blow up i18n.T, _ = go_i18n.Tfunc("") p := CfPlugin{ Deployer: &BlueGreenDeploy{ ErrorFunc: func(message string, err error) { fmt.Printf("%v - %v\n", message, err) os.Exit(1) }, Out: os.Stdout, }, } plugin.Start(&p) }
func main() { plugin.Start(new(V3Plugin)) }
func main() { plugin.Start(new(MultiCmd)) }
func main() { plugin.Start(new(CliCmd)) }
func main() { plugin.Start(new(TestWithOrgs)) }
func main() { plugin.Start(new(PluginDemonstratingParams)) }
func main() { plugin.Start(new(Input)) }
func main() { plugin.Start(new(AliasConflicts)) }
func main() { plugin.Start(new(Panics)) }
func main() { plugin.Start(new(DemoCmd)) }
func main() { plugin.Start(new(EmptyPlugin)) }
func main() { plugin.Start(new(TestWithHelp)) }
func main() { plugin.Start(new(CoreCmd)) }
func main() { plugin.Start(new(Test1)) }
func main() { plugin.Start(new(MySay)) }
func main() { plugin.Start(new(TestWithOrgsShortName)) }
func main() { plugin.Start(new(TestWithPush)) }
func main() { plugin.Start(new(Interactive)) }