energy/cmd/command.go

40 lines
1.3 KiB
Go
Raw Normal View History

//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under GNU General Public License v3.0
//
//----------------------------------------
2022-11-09 11:50:59 +08:00
package cmd
type CommandConfig struct {
2022-11-09 12:12:40 +08:00
Index int
Wd string
2022-11-09 11:50:59 +08:00
Install Install `command:"install"`
Package Package `command:"package"`
2022-11-18 12:56:27 +08:00
Version Version `command:"version"`
2022-11-09 11:50:59 +08:00
}
type Install struct {
2022-11-18 12:15:47 +08:00
Path string `short:"p" long:"path" description:"Installation directory Default current directory"`
Version string `short:"v" long:"version" description:"Specifying a version number"`
Name string `short:"n" long:"name" description:"Name of the frame after installation" default:"EnergyFramework"`
Download string `short:"d" long:"download" description:"Download Source, gitee or github, Default gitee" default:"gitee"`
2022-11-09 11:50:59 +08:00
}
type Package struct {
2022-11-11 22:24:17 +08:00
Path string `short:"p" long:"path" description:"Package directory"`
Mode string `short:"m" long:"mode" description:"Use mode to set online or offline, offline by default." default:"offline"`
Out string `short:"o" long:"out" description:"Output directory" default:"EnergyInstallPkg"`
2022-11-09 11:50:59 +08:00
}
2022-11-09 12:12:40 +08:00
2022-11-18 12:56:27 +08:00
type Version struct {
All bool `short:"a" long:"all" description:"show all"`
}
2022-11-09 12:12:40 +08:00
type Command struct {
Run func(c *CommandConfig) error
UsageLine, Short, Long string
}