Skip to content

Commit 5aaed4b

Browse files
committed
fix: fix some tests error
1 parent adfe61b commit 5aaed4b

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

app.go

+1
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ func (app *App) findCommandName() (name string) {
403403
if app.IsCommand(realName) {
404404
app.inputName = name
405405
Debugf("the alias name: '<cyan>%s</>', real command: '<green>%s</>'", name, realName)
406+
return realName
406407
}
407408

408409
// not exists

app_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var (
4343
Name: "sub1",
4444
Desc: "desc for top1.sub1",
4545
Func: func(c *gcli.Command, args []string) error {
46-
c.SetValue("msg", c.App().Value("top1.sub1"))
46+
c.SetValue("msg", c.App().Value("top1:sub1"))
4747
return nil
4848
},
4949
},

base_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
func TestApp_On(t *testing.T) {
1010
cli := gcli.New()
11+
cli.ExitOnEnd = false
1112

1213
args := []string{"top", "sub"}
1314
cli.Run(args)

0 commit comments

Comments
 (0)