func appSwitchAction(c *cli.Context) {
	if c.NArg() != 1 {
		log.Fatal("Usage: lean app switch <app-name>")
	}
	appName := c.Args()[0]

	utils.CheckError(apps.SwitchApp("", appName))
}
Beispiel #2
0
func appAddAction(c *cli.Context) {
	var appName, appID string
	wizard.Ask([]wizard.Question{
		{
			Content: "请输入应用名:",
			Input: &wizard.Input{
				Hidden: false,
				Result: &appName,
			},
		},
		{
			Content: "请输入应用 appID:",
			Input: &wizard.Input{
				Hidden: false,
				Result: &appID,
			},
		},
	})

	utils.CheckError(apps.AddApp("", appName, appID))
	utils.CheckError(apps.SwitchApp("", appName))
	log.Println("已切换至应用:" + appName)
}