diff --git a/cmd/internal/run/run.go b/cmd/internal/run/run.go index ec79238a0..3317cfad1 100644 --- a/cmd/internal/run/run.go +++ b/cmd/internal/run/run.go @@ -37,8 +37,8 @@ var Cmd = &base.Command{ // llgo cmptest var CmpTestCmd = &base.Command{ - UsageLine: "llgo cmptest [-genexpect] [build flags] package [arguments...]", - Short: "Compile and run with llgo, compare result (stdout/stderr/exitcode) with go or llgo.expect; generate llgo.expect file if -genexpect is specified", + UsageLine: "llgo cmptest [-gen] [build flags] package [arguments...]", + Short: "Compile and run with llgo, compare result (stdout/stderr/exitcode) with go or llgo.expect; generate llgo.expect file if -gen is specified", } func init() { @@ -54,9 +54,9 @@ func runCmpTest(cmd *base.Command, args []string) { runCmdEx(cmd, args, build.ModeCmpTest) } -func runCmdEx(cmd *base.Command, args []string, mode build.Mode) { +func runCmdEx(_ *base.Command, args []string, mode build.Mode) { conf := build.NewDefaultConf(mode) - if mode == build.ModeCmpTest && len(args) > 0 && args[0] == "-genexpect" { + if mode == build.ModeCmpTest && len(args) > 0 && args[0] == "-gen" { conf.GenExpect = true args = args[1:] } diff --git a/internal/build/build.go b/internal/build/build.go index 2c056199f..557763efe 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -68,8 +68,8 @@ type Config struct { AppExt string // ".exe" on Windows, empty on Unix OutFile string // only valid for ModeBuild when len(pkgs) == 1 RunArgs []string // only valid for ModeRun - GenExpect bool // only valid for ModeCmpTest Mode Mode + GenExpect bool // only valid for ModeCmpTest } func NewDefaultConf(mode Mode) *Config {