This commit is contained in:
zhangwenjian committed 2020-04-21 13:39:40 +08:00
1 parent e174f1e740
commit 6bb6c69700
6 files changed
+51 -57

No files matched your search

+8 -1
View File
@@ -1,6 +1,7 @@
package cmd
import (
"errors"
"github.com/spf13/cobra"
"go-admin/cmd/api"
"go-admin/cmd/migrate"
@@ -14,6 +15,12 @@ var rootCmd = &cobra.Command{
SilenceUsage: true,
DisableAutoGenTag: true,
Long: `go-admin`,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("requires at least one arg")
}
return nil
},
PersistentPreRunE: func(*cobra.Command, []string) error { return nil },
Run: func(cmd *cobra.Command, args []string) {
usageStr := `go-admin 0.0.1`
@@ -31,4 +38,4 @@ func Execute() {
if err := rootCmd.Execute(); err != nil {
os.Exit(-1)
}
}
}