Skip to content

Commit

Permalink
Merge pull request #62 from aisbergg/master
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere authored Aug 9, 2022
2 parents bfdd98d + 0c89eea commit 4fa6d74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 8 additions & 5 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,15 @@ func (app *App) prepareRun() (code int, name string) {
if app.inputName == "" {
Logf(VerbDebug, "input the command is not an registered: %s", name)

if stop := app.Fire(EvtAppCmdNotFound, name); stop == false {
stop = app.Fire(EvtCmdNotFound, name)
if stop == false {
app.showCommandTips(name)
}
// fire events
if stop := app.Fire(EvtAppCmdNotFound, name); stop {
return
}
if stop := app.Fire(EvtCmdNotFound, name); stop {
return
}

app.showCommandTips(name)
return
}

Expand Down
6 changes: 2 additions & 4 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,10 @@ func (c *Command) innerDispatch(args []string) (err error) {
// no arguments, name is not founded subcommand
if !c.HasArguments() {
// fire events
stop := c.Fire(EvtCmdSubNotFound, name)
if stop == true {
if stop := c.Fire(EvtCmdSubNotFound, name); stop {
return
}

if stop = c.Fire(EvtCmdNotFound, name); stop == false {
if stop := c.Fire(EvtCmdNotFound, name); stop {
return
}

Expand Down

0 comments on commit 4fa6d74

Please sign in to comment.