Beispiel #1
0
func main() {
	modName, err := cli.GetModuleName()
	if err != nil {
		log.Fatalf(err.Error())
	}

	app, err := cli.NewApp(
		"0.1.0",
		"Mesosphere",
		fmt.Sprintf("Deploy and manage %s clusters", strings.Title(modName)))
	if err != nil {
		log.Fatalf(err.Error())
	}

	handleBrokerSection(app)
	handleTopicSection(app)
	cli.HandleCommonArgs(
		app,
		modName,
		fmt.Sprintf("%s DC/OS CLI Module", strings.Title(modName)),
		[]string{"address", "dns"})

	// Omit modname:
	kingpin.MustParse(app.Parse(os.Args[2:]))
}
func main() {
	modName, err := cli.GetModuleName()
	if err != nil {
		log.Fatalf(err.Error())
	}
	// Prettify the user-visible service name:
	serviceName := strings.Title(modName) // eg 'Cassandra'
	if modName == "dse" {
		serviceName = "DSE"
	}

	app, err := cli.NewApp(
		"0.1.0",
		"Mesosphere",
		fmt.Sprintf("Deploy and manage %s clusters", serviceName))
	if err != nil {
		log.Fatalf(err.Error())
	}

	// Omit standard "connection" section. Cassandra isn't on the standard paths yet, and omit
	// standard "config" and "state" sections since Cassandra isn't installing
	// ConfigResource/StateResource yet.
	cli.HandleCommonFlags(app, modName, fmt.Sprintf("%s DC/OS CLI Module", serviceName))
	//cli.HandleConfigSection(app)
	//cli.HandleConnectionSection(app)
	cli.HandlePlanSection(app)
	//cli.HandleStateSection(app)

	handleSeedsCommand(app)
	handleCustomConnectionCommand(app, serviceName)

	handleNodeSection(app, serviceName)
	handleBackupRestoreSections(app, serviceName)
	handleCleanupRepairSections(app)

	// Omit modname:
	kingpin.MustParse(app.Parse(os.Args[2:]))
}