Files
llgo/cmd/llgo/gop_autogen.go
2025-05-08 09:34:01 +08:00

251 lines
6.6 KiB
Go

// Code generated by gop (Go+); DO NOT EDIT.
package main
import (
"fmt"
"github.com/goplus/cobra/xcmd"
"github.com/goplus/llgo/cmd/internal/build"
"github.com/goplus/llgo/cmd/internal/clean"
"github.com/goplus/llgo/cmd/internal/install"
"github.com/goplus/llgo/cmd/internal/run"
"github.com/goplus/llgo/cmd/internal/test"
"github.com/goplus/llgo/internal/env"
"github.com/goplus/llgo/xtool/cppkg"
"github.com/qiniu/x/stringutil"
"runtime"
)
const _ = true
type Cmd_build struct {
xcmd.Command
*App
}
type Cmd_clean struct {
xcmd.Command
*App
}
type Cmd_cmptest struct {
xcmd.Command
*App
}
type Cmd_cppkg struct {
xcmd.Command
*App
}
type Cmd_cppkg_install struct {
xcmd.Command
*App
}
type Cmd_get struct {
xcmd.Command
*App
}
type Cmd_install struct {
xcmd.Command
*App
}
type App struct {
xcmd.App
}
type Cmd_run struct {
xcmd.Command
*App
}
type Cmd_test struct {
xcmd.Command
*App
}
type Cmd_version struct {
xcmd.Command
*App
}
//line cmd/llgo/main_app.gox:1
func (this *App) MainEntry() {
//line cmd/llgo/main_app.gox:1:1
this.Short(`llgo is a Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python.`)
}
func (this *App) Main() {
_gop_obj0 := &Cmd_build{App: this}
_gop_obj1 := &Cmd_clean{App: this}
_gop_obj2 := &Cmd_cmptest{App: this}
_gop_obj3 := &Cmd_cppkg{App: this}
_gop_obj4 := &Cmd_cppkg_install{App: this}
_gop_obj5 := &Cmd_get{App: this}
_gop_obj6 := &Cmd_install{App: this}
_gop_obj7 := &Cmd_run{App: this}
_gop_obj8 := &Cmd_test{App: this}
_gop_obj9 := &Cmd_version{App: this}
xcmd.Gopt_App_Main(this, _gop_obj0, _gop_obj1, _gop_obj2, _gop_obj3, _gop_obj4, _gop_obj5, _gop_obj6, _gop_obj7, _gop_obj8, _gop_obj9)
}
//line cmd/llgo/build_cmd.gox:20
func (this *Cmd_build) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/build_cmd.gox:20:1
this.Short("Compile packages and dependencies")
//line cmd/llgo/build_cmd.gox:22:1
this.FlagOff()
//line cmd/llgo/build_cmd.gox:24:1
this.Run__1(func(args []string) {
//line cmd/llgo/build_cmd.gox:25:1
build.Cmd.Run(build.Cmd, args)
})
}
func (this *Cmd_build) Classfname() string {
return "build"
}
//line cmd/llgo/clean_cmd.gox:20
func (this *Cmd_clean) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/clean_cmd.gox:20:1
this.Short("Remove object files and cached files")
//line cmd/llgo/clean_cmd.gox:22:1
this.FlagOff()
//line cmd/llgo/clean_cmd.gox:24:1
this.Run__1(func(args []string) {
//line cmd/llgo/clean_cmd.gox:25:1
clean.Cmd.Run(clean.Cmd, args)
})
}
func (this *Cmd_clean) Classfname() string {
return "clean"
}
//line cmd/llgo/cmptest_cmd.gox:20
func (this *Cmd_cmptest) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/cmptest_cmd.gox:20:1
this.Short("Compile and run with llgo, compare result (stdout/stderr/exitcode) with go or llgo.expect; generate llgo.expect file if -gen is specified")
//line cmd/llgo/cmptest_cmd.gox:22:1
this.FlagOff()
//line cmd/llgo/cmptest_cmd.gox:24:1
this.Run__1(func(args []string) {
//line cmd/llgo/cmptest_cmd.gox:25:1
run.CmpTestCmd.Run(run.CmpTestCmd, args)
})
}
func (this *Cmd_cmptest) Classfname() string {
return "cmptest"
}
//line cmd/llgo/cppkg_cmd.gox:16
func (this *Cmd_cppkg) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/cppkg_cmd.gox:16:1
this.Short("Manage C/C++ packages")
//line cmd/llgo/cppkg_cmd.gox:18:1
this.Run__0(func() {
//line cmd/llgo/cppkg_cmd.gox:19:1
this.Help()
})
}
func (this *Cmd_cppkg) Classfname() string {
return "cppkg"
}
//line cmd/llgo/cppkg_install_cmd.gox:20
func (this *Cmd_cppkg_install) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/cppkg_install_cmd.gox:20:1
this.Short("Install a C/C++ package from github.com/goplus/cppkg")
//line cmd/llgo/cppkg_install_cmd.gox:22:1
this.Long(`Installs a C/C++ package with the given name and version. For example:
llgo cppkg install davegamble/cjson@1.7.18
llgo cppkg install davegamble/cjson@latest
llgo cppkg install davegamble/cjson
`)
//line cmd/llgo/cppkg_install_cmd.gox:29:1
this.Run__1(func(args []string) {
//line cmd/llgo/cppkg_install_cmd.gox:30:1
if len(args) < 1 {
//line cmd/llgo/cppkg_install_cmd.gox:31:1
this.Help()
//line cmd/llgo/cppkg_install_cmd.gox:32:1
return
}
//line cmd/llgo/cppkg_install_cmd.gox:35:1
cppkg.Install(args[0], cppkg.DefaultFlags)
})
}
func (this *Cmd_cppkg_install) Classfname() string {
return "cppkg_install"
}
//line cmd/llgo/get_cmd.gox:16
func (this *Cmd_get) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/get_cmd.gox:16:1
this.Short("Add dependencies to current module and install them")
//line cmd/llgo/get_cmd.gox:18:1
this.Run__1(func(args []string) {
//line cmd/llgo/get_cmd.gox:19:1
panic("todo")
})
}
func (this *Cmd_get) Classfname() string {
return "get"
}
//line cmd/llgo/install_cmd.gox:20
func (this *Cmd_install) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/install_cmd.gox:20:1
this.Short("Compile and install packages and dependencies")
//line cmd/llgo/install_cmd.gox:22:1
this.FlagOff()
//line cmd/llgo/install_cmd.gox:24:1
this.Run__1(func(args []string) {
//line cmd/llgo/install_cmd.gox:25:1
install.Cmd.Run(install.Cmd, args)
})
}
func (this *Cmd_install) Classfname() string {
return "install"
}
//line cmd/llgo/run_cmd.gox:20
func (this *Cmd_run) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/run_cmd.gox:20:1
this.Short("Compile and run Go program")
//line cmd/llgo/run_cmd.gox:22:1
this.FlagOff()
//line cmd/llgo/run_cmd.gox:24:1
this.Run__1(func(args []string) {
//line cmd/llgo/run_cmd.gox:25:1
run.Cmd.Run(run.Cmd, args)
})
}
func (this *Cmd_run) Classfname() string {
return "run"
}
//line cmd/llgo/test_cmd.gox:20
func (this *Cmd_test) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/test_cmd.gox:20:1
this.Short("Compile and run Go test")
//line cmd/llgo/test_cmd.gox:22:1
this.FlagOff()
//line cmd/llgo/test_cmd.gox:24:1
this.Run__1(func(args []string) {
//line cmd/llgo/test_cmd.gox:25:1
test.Cmd.Run(test.Cmd, args)
})
}
func (this *Cmd_test) Classfname() string {
return "test"
}
//line cmd/llgo/version_cmd.gox:22
func (this *Cmd_version) Main(_gop_arg0 string) {
this.Command.Main(_gop_arg0)
//line cmd/llgo/version_cmd.gox:22:1
this.Short("Print LLGo version")
//line cmd/llgo/version_cmd.gox:24:1
this.Run__0(func() {
//line cmd/llgo/version_cmd.gox:25:1
fmt.Println(stringutil.Concat("llgo ", env.Version(), " ", runtime.GOOS, "/", runtime.GOARCH))
})
}
func (this *Cmd_version) Classfname() string {
return "version"
}
func main() {
new(App).Main()
}