mirror of
https://gitee.com/energye/energy.git
synced 2024-12-03 12:17:44 +08:00
U: upgrade command-line tool
This commit is contained in:
parent
23554bf6fc
commit
72f614b40e
@ -25,6 +25,7 @@ var commands = []*internal.Command{
|
||||
internal.CmdSetenv,
|
||||
internal.CmdEnv,
|
||||
internal.CmdCreate,
|
||||
internal.CmdBuild,
|
||||
}
|
||||
|
||||
func main() {
|
||||
@ -52,6 +53,8 @@ func main() {
|
||||
cc.Index = 5
|
||||
case "create":
|
||||
cc.Index = 6
|
||||
case "build":
|
||||
cc.Index = 7
|
||||
}
|
||||
command := commands[cc.Index]
|
||||
if len(extraArgs) < 1 || extraArgs[len(extraArgs)-1] != "." {
|
||||
|
@ -11,3 +11,20 @@
|
||||
// 构建编译 energy 项目
|
||||
|
||||
package internal
|
||||
|
||||
var CmdBuild = &Command{
|
||||
UsageLine: "build",
|
||||
Short: "build energy project",
|
||||
Long: `
|
||||
Building energy project
|
||||
. Execute default command
|
||||
`,
|
||||
}
|
||||
|
||||
func init() {
|
||||
CmdBuild.Run = runBuild
|
||||
}
|
||||
|
||||
func runBuild(c *CommandConfig) error {
|
||||
return nil
|
||||
}
|
||||
|
@ -19,6 +19,12 @@ type CommandConfig struct {
|
||||
Setenv Setenv `command:"setenv"`
|
||||
Env Env `command:"env"`
|
||||
Create Create `command:"create"`
|
||||
Build Build `command:"build"`
|
||||
}
|
||||
|
||||
type Command struct {
|
||||
Run func(c *CommandConfig) error
|
||||
UsageLine, Short, Long string
|
||||
}
|
||||
|
||||
type Install struct {
|
||||
@ -46,10 +52,8 @@ type Version struct {
|
||||
All bool `short:"a" long:"all" description:"show all"`
|
||||
}
|
||||
|
||||
type Command struct {
|
||||
Run func(c *CommandConfig) error
|
||||
UsageLine, Short, Long string
|
||||
}
|
||||
|
||||
type Create struct {
|
||||
}
|
||||
|
||||
type Build struct {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user