Handle Before and After of Command without handling it as subCommand if there is no subCommand.
This commit is contained in:
@@ -942,6 +942,11 @@ func TestApp_Run_SubcommandDoesNotOverwriteErrorFromBefore(t *testing.T) {
|
||||
app := NewApp()
|
||||
app.Commands = []Command{
|
||||
Command{
|
||||
Subcommands: []Command{
|
||||
Command{
|
||||
Name: "sub",
|
||||
},
|
||||
},
|
||||
Name: "bar",
|
||||
Before: func(c *Context) error { return fmt.Errorf("before error") },
|
||||
After: func(c *Context) error { return fmt.Errorf("after error") },
|
||||
|
Reference in New Issue
Block a user