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:
@@ -6,7 +6,7 @@ import (
|
||||
"os/exec"
|
||||
"runtime"
|
||||
|
||||
"github.com/urfave/cli"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/zeromicro/go-zero/tools/goctl/internal/version"
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ var openCmd = map[string]string{
|
||||
darwin: darwinOpen,
|
||||
}
|
||||
|
||||
func Action(_ *cli.Context) error {
|
||||
func runE(_ *cobra.Command, _ []string) error {
|
||||
env := getEnv()
|
||||
content := fmt.Sprintf(issueTemplate, version.BuildVersion, env.string())
|
||||
content = url.QueryEscape(content)
|
||||
|
||||
11
tools/goctl/bug/cmd.go
Normal file
11
tools/goctl/bug/cmd.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package bug
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
// Cmd describes a bug command.
|
||||
var Cmd = &cobra.Command{
|
||||
Use: "bug",
|
||||
Short: "Report a bug",
|
||||
Args: cobra.NoArgs,
|
||||
RunE: runE,
|
||||
}
|
||||
Reference in New Issue
Block a user