2025-06-12 18:49:17 +08:00
// Code generated by xgo (XGo); DO NOT EDIT.
2025-05-04 15:34:32 +08:00
package main
import (
"fmt"
"github.com/goplus/cobra/xcmd"
2025-05-08 09:34:01 +08:00
"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"
2025-05-04 15:34:32 +08:00
"github.com/goplus/llgo/internal/env"
"github.com/qiniu/x/stringutil"
"runtime"
)
const _ = true
2025-05-08 09:34:01 +08:00
type Cmd_build struct {
2025-05-04 15:34:32 +08:00
xcmd . Command
* App
}
2025-05-08 09:34:01 +08:00
type Cmd_clean struct {
2025-05-04 15:34:32 +08:00
xcmd . Command
* App
}
2025-05-08 09:34:01 +08:00
type Cmd_cmptest struct {
2025-05-04 15:34:32 +08:00
xcmd . Command
* App
}
2025-05-08 09:34:01 +08:00
type Cmd_get struct {
2025-05-04 15:34:32 +08:00
xcmd . Command
* App
}
2025-05-08 09:34:01 +08:00
type Cmd_install struct {
2025-05-04 15:34:32 +08:00
xcmd . Command
* App
}
2025-05-07 22:30:54 +08:00
type App struct {
xcmd . App
}
2025-05-08 09:34:01 +08:00
type Cmd_run struct {
2025-05-04 15:34:32 +08:00
xcmd . Command
* App
}
2025-05-08 09:34:01 +08:00
type Cmd_test struct {
2025-05-04 15:34:32 +08:00
xcmd . Command
* App
}
2025-05-08 09:34:01 +08:00
type Cmd_version struct {
2025-05-04 15:34:32 +08:00
xcmd . Command
* App
}
2025-05-08 09:34:01 +08:00
//line cmd/llgo/main_app.gox:1
2025-05-07 22:30:54 +08:00
func ( this * App ) MainEntry ( ) {
2025-05-08 09:34:01 +08:00
//line cmd/llgo/main_app.gox:1:1
2025-05-07 22:30:54 +08:00
this . Short ( ` llgo is a Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python. ` )
2025-05-04 15:34:32 +08:00
}
func ( this * App ) Main ( ) {
2025-06-12 18:49:17 +08:00
_xgo_obj0 := & Cmd_build { App : this }
_xgo_obj1 := & Cmd_clean { App : this }
_xgo_obj2 := & Cmd_cmptest { App : this }
_xgo_obj3 := & Cmd_get { App : this }
_xgo_obj4 := & Cmd_install { App : this }
_xgo_obj5 := & Cmd_run { App : this }
_xgo_obj6 := & Cmd_test { App : this }
_xgo_obj7 := & Cmd_version { App : this }
xcmd . Gopt_App_Main ( this , _xgo_obj0 , _xgo_obj1 , _xgo_obj2 , _xgo_obj3 , _xgo_obj4 , _xgo_obj5 , _xgo_obj6 , _xgo_obj7 )
2025-05-04 15:34:32 +08:00
}
//line cmd/llgo/build_cmd.gox:20
2025-06-12 18:49:17 +08:00
func ( this * Cmd_build ) Main ( _xgo_arg0 string ) {
this . Command . Main ( _xgo_arg0 )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/build_cmd.gox:20:1
2025-05-09 10:24:54 +08:00
this . Use ( "build [flags] [packages]" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/build_cmd.gox:22:1
2025-05-09 10:24:54 +08:00
this . Short ( "Compile packages and dependencies" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/build_cmd.gox:24:1
2025-05-09 10:24:54 +08:00
this . FlagOff ( )
//line cmd/llgo/build_cmd.gox:26:1
2025-05-04 15:34:32 +08:00
this . Run__1 ( func ( args [ ] string ) {
2025-05-09 10:24:54 +08:00
//line cmd/llgo/build_cmd.gox:27:1
2025-05-08 09:34:01 +08:00
build . Cmd . Run ( build . Cmd , args )
2025-05-04 15:34:32 +08:00
} )
}
2025-05-08 09:34:01 +08:00
func ( this * Cmd_build ) Classfname ( ) string {
2025-05-04 15:34:32 +08:00
return "build"
}
//line cmd/llgo/clean_cmd.gox:20
2025-06-12 18:49:17 +08:00
func ( this * Cmd_clean ) Main ( _xgo_arg0 string ) {
this . Command . Main ( _xgo_arg0 )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/clean_cmd.gox:20:1
2025-05-09 10:24:54 +08:00
this . Use ( "clean [flags] [packages]" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/clean_cmd.gox:22:1
2025-05-09 10:24:54 +08:00
this . Short ( "Remove object files and cached files" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/clean_cmd.gox:24:1
2025-05-09 10:24:54 +08:00
this . FlagOff ( )
//line cmd/llgo/clean_cmd.gox:26:1
2025-05-04 15:34:32 +08:00
this . Run__1 ( func ( args [ ] string ) {
2025-05-09 10:24:54 +08:00
//line cmd/llgo/clean_cmd.gox:27:1
2025-05-08 09:34:01 +08:00
clean . Cmd . Run ( clean . Cmd , args )
2025-05-04 15:34:32 +08:00
} )
}
2025-05-08 09:34:01 +08:00
func ( this * Cmd_clean ) Classfname ( ) string {
2025-05-04 15:34:32 +08:00
return "clean"
}
//line cmd/llgo/cmptest_cmd.gox:20
2025-06-12 18:49:17 +08:00
func ( this * Cmd_cmptest ) Main ( _xgo_arg0 string ) {
this . Command . Main ( _xgo_arg0 )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/cmptest_cmd.gox:20:1
2025-05-09 10:24:54 +08:00
this . Use ( "cmptest [flags] package [arguments...]" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/cmptest_cmd.gox:22:1
2025-05-09 10:24:54 +08:00
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" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/cmptest_cmd.gox:24:1
2025-05-09 10:24:54 +08:00
this . FlagOff ( )
//line cmd/llgo/cmptest_cmd.gox:26:1
2025-05-04 15:34:32 +08:00
this . Run__1 ( func ( args [ ] string ) {
2025-05-09 10:24:54 +08:00
//line cmd/llgo/cmptest_cmd.gox:27:1
2025-05-08 09:34:01 +08:00
run . CmpTestCmd . Run ( run . CmpTestCmd , args )
2025-05-04 15:34:32 +08:00
} )
}
2025-05-08 09:34:01 +08:00
func ( this * Cmd_cmptest ) Classfname ( ) string {
2025-05-04 15:34:32 +08:00
return "cmptest"
}
//line cmd/llgo/get_cmd.gox:16
2025-06-12 18:49:17 +08:00
func ( this * Cmd_get ) Main ( _xgo_arg0 string ) {
this . Command . Main ( _xgo_arg0 )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/get_cmd.gox:16:1
2025-05-09 10:24:54 +08:00
this . Use ( "get [flags] [packages]" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/get_cmd.gox:18:1
2025-05-09 10:24:54 +08:00
this . Short ( "Add dependencies to current module and install them" )
//line cmd/llgo/get_cmd.gox:20:1
2025-05-04 15:34:32 +08:00
this . Run__1 ( func ( args [ ] string ) {
2025-05-09 10:24:54 +08:00
//line cmd/llgo/get_cmd.gox:21:1
2025-05-04 15:34:32 +08:00
panic ( "todo" )
} )
}
2025-05-08 09:34:01 +08:00
func ( this * Cmd_get ) Classfname ( ) string {
2025-05-04 15:34:32 +08:00
return "get"
}
//line cmd/llgo/install_cmd.gox:20
2025-06-12 18:49:17 +08:00
func ( this * Cmd_install ) Main ( _xgo_arg0 string ) {
this . Command . Main ( _xgo_arg0 )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/install_cmd.gox:20:1
2025-05-09 10:24:54 +08:00
this . Use ( "install [flags] [packages]" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/install_cmd.gox:22:1
2025-05-09 10:24:54 +08:00
this . Short ( "Compile and install packages and dependencies" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/install_cmd.gox:24:1
2025-05-09 10:24:54 +08:00
this . FlagOff ( )
//line cmd/llgo/install_cmd.gox:26:1
2025-05-04 15:34:32 +08:00
this . Run__1 ( func ( args [ ] string ) {
2025-05-09 10:24:54 +08:00
//line cmd/llgo/install_cmd.gox:27:1
2025-05-08 09:34:01 +08:00
install . Cmd . Run ( install . Cmd , args )
2025-05-04 15:34:32 +08:00
} )
}
2025-05-08 09:34:01 +08:00
func ( this * Cmd_install ) Classfname ( ) string {
2025-05-04 15:34:32 +08:00
return "install"
}
//line cmd/llgo/run_cmd.gox:20
2025-06-12 18:49:17 +08:00
func ( this * Cmd_run ) Main ( _xgo_arg0 string ) {
this . Command . Main ( _xgo_arg0 )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/run_cmd.gox:20:1
2025-05-09 10:24:54 +08:00
this . Use ( "run [flags] package [arguments...]" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/run_cmd.gox:22:1
2025-05-09 10:24:54 +08:00
this . Short ( "Compile and run Go program" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/run_cmd.gox:24:1
2025-05-09 10:24:54 +08:00
this . FlagOff ( )
//line cmd/llgo/run_cmd.gox:26:1
2025-05-04 15:34:32 +08:00
this . Run__1 ( func ( args [ ] string ) {
2025-05-09 10:24:54 +08:00
//line cmd/llgo/run_cmd.gox:27:1
2025-05-08 09:34:01 +08:00
run . Cmd . Run ( run . Cmd , args )
2025-05-04 15:34:32 +08:00
} )
}
2025-05-08 09:34:01 +08:00
func ( this * Cmd_run ) Classfname ( ) string {
2025-05-04 15:34:32 +08:00
return "run"
}
//line cmd/llgo/test_cmd.gox:20
2025-06-12 18:49:17 +08:00
func ( this * Cmd_test ) Main ( _xgo_arg0 string ) {
this . Command . Main ( _xgo_arg0 )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/test_cmd.gox:20:1
2025-05-09 10:24:54 +08:00
this . Use ( "test [flags] package [arguments...]" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/test_cmd.gox:22:1
2025-05-09 10:24:54 +08:00
this . Short ( "Compile and run Go test" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/test_cmd.gox:24:1
2025-05-09 10:24:54 +08:00
this . FlagOff ( )
//line cmd/llgo/test_cmd.gox:26:1
2025-05-04 15:34:32 +08:00
this . Run__1 ( func ( args [ ] string ) {
2025-05-09 10:24:54 +08:00
//line cmd/llgo/test_cmd.gox:27:1
2025-05-08 09:34:01 +08:00
test . Cmd . Run ( test . Cmd , args )
2025-05-04 15:34:32 +08:00
} )
}
2025-05-08 09:34:01 +08:00
func ( this * Cmd_test ) Classfname ( ) string {
2025-05-04 15:34:32 +08:00
return "test"
}
//line cmd/llgo/version_cmd.gox:22
2025-06-12 18:49:17 +08:00
func ( this * Cmd_version ) Main ( _xgo_arg0 string ) {
this . Command . Main ( _xgo_arg0 )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/version_cmd.gox:22:1
2025-05-09 10:24:54 +08:00
this . Use ( "version" )
2025-05-04 15:34:32 +08:00
//line cmd/llgo/version_cmd.gox:24:1
2025-05-09 10:24:54 +08:00
this . Short ( "Print LLGo version" )
//line cmd/llgo/version_cmd.gox:26:1
2025-05-04 15:34:32 +08:00
this . Run__0 ( func ( ) {
2025-05-09 10:24:54 +08:00
//line cmd/llgo/version_cmd.gox:27:1
2025-05-04 15:34:32 +08:00
fmt . Println ( stringutil . Concat ( "llgo " , env . Version ( ) , " " , runtime . GOOS , "/" , runtime . GOARCH ) )
} )
}
2025-05-08 09:34:01 +08:00
func ( this * Cmd_version ) Classfname ( ) string {
2025-05-04 15:34:32 +08:00
return "version"
}
func main ( ) {
new ( App ) . Main ( )
}