XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/gpt4free

Update main.go

56a3f1de
H Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +4 -1
Modified g4f-go/main.go +4 -1
@@ -10,6 +10,7 @@ import (
10 10
11 11 func main() {
12 12 // Meta commands must work even without an embedded runtime.
13 module := "g4f"
13 14 switch {
14 15 case len(os.Args) == 1:
15 16 printHelp()
@@ -20,6 +21,8 @@ func main() {
20 21 case os.Args[1] == "help" || os.Args[1] == "--help" || os.Args[1] == "-h":
21 22 printHelp()
22 23 os.Exit(0)
24 case os.Args[1] == "install" || os.Args[1] == "uninstall":
25 module := "pip"
23 26 }
24 27
25 28 // Make sure the embedded Python runtime is extracted to ~/.g4f/python-embed.
@@ -33,7 +36,7 @@ func main() {
33 36 defer stop()
34 37
35 38 // Forward all arguments to g4f's own CLI entry point.
36 code, err := runPython(ctx, py, append([]string{"-m", "g4f"}, os.Args[1:]...))
39 code, err := runPython(ctx, py, append([]string{"-m", module}, os.Args[1:]...))
37 40 if err != nil {
38 41 fmt.Fprintln(os.Stderr, "g4f-go:", err)
39 42 os.Exit(1)