This commit is contained in:
chermack
2026-07-26 00:09:57 +08:00
commit 059be96536
134 changed files with 19678 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"trojan/core"
"trojan/util"
)
// exportCmd represents the export command
var exportCmd = &cobra.Command{
Use: "export",
Short: "导出数据库sql文件",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
mysql := core.GetMysql()
if err := mysql.DumpSql(args[0]); err != nil {
fmt.Println(util.Red(err.Error()))
} else {
fmt.Println(util.Green("导出sql成功!"))
}
},
}
func init() {
rootCmd.AddCommand(exportCmd)
}