You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System (please complete the following information):
OS: windows 10
GO Version: 1.21.6
Pkg Version: v3.2.3
Describe the bug
I set a ‘run’ command for the app through ‘app.SetDefaultCommand’, and want the app to execute the ‘run’ command by default (./app). But after compiling, I run ‘./app’ and get an error ‘ERROR: unknown input command "run"’
func (app*App) prepareRun() (codeint, namestring) {
// find command name.name=app.findCommandName()
ifname==HelpCommand {
iflen(app.args) ==0 { // like 'help'app.showApplicationHelp()
} else {
// like 'help COMMAND'code=app.showCommandHelp(app.args)
}
return
}
// not input and not set defaultCommandifname=="" {
ifapp.Func!=nil {
code=app.doRunFunc(app.args)
} else {
app.showApplicationHelp()
}
return
}
// name is not empty, but is not command.ifapp.inputName=="" {
Logf(VerbDebug, "input the command is not an registered: %s", name)
hookData:=map[string]any{"name": name, "args": app.args}
// fire eventsifstop:=app.Fire(events.OnAppCmdNotFound, hookData); stop {
return
}
ifstop:=app.Fire(events.OnCmdNotFound, hookData); stop {
return
}
app.showCommandTips(name)
return
}
// is valid command name.app.commandName=namereturnGOON, name
}
I debug to this code , app.inputName is empty ,Caused the default command to fail
System (please complete the following information):
windows 10
1.21.6
v3.2.3
Describe the bug
I set a ‘run’ command for the app through ‘app.SetDefaultCommand’, and want the app to execute the ‘run’ command by default (./app). But after compiling, I run ‘./app’ and get an error ‘ERROR: unknown input command "run"’
To Reproduce
Expected behavior
I expected to happen: execute "./app" command, then the app will execute 'run' command,just like execute "./app run"
The text was updated successfully, but these errors were encountered: