feat: Replace cli to cobra (#1855)
* Replace cli * Replace cli * Replace cli * Format code * Add compare case * Add compare case * Add compare case * Support go style flag * Support go style flag * Add test case
This commit is contained in:
9
tools/goctl/env/env.go
vendored
9
tools/goctl/env/env.go
vendored
@@ -3,14 +3,13 @@ package env
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/urfave/cli"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/zeromicro/go-zero/tools/goctl/pkg/env"
|
||||
)
|
||||
|
||||
func Action(c *cli.Context) error {
|
||||
write := c.StringSlice("write")
|
||||
if len(write) > 0 {
|
||||
return env.WriteEnv(write)
|
||||
func write(_ *cobra.Command, _ []string) error {
|
||||
if len(sliceVarWriteValue) > 0 {
|
||||
return env.WriteEnv(sliceVarWriteValue)
|
||||
}
|
||||
fmt.Println(env.Print())
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user