mirror of
https://github.com/beego/bee.git
synced 2025-07-05 18:20:18 +00:00
return actual value from subcommand
This commit is contained in:
5
bee.go
5
bee.go
@ -30,7 +30,7 @@ const version = "1.2.1"
|
||||
type Command struct {
|
||||
// Run runs the command.
|
||||
// The args are the arguments after the command name.
|
||||
Run func(cmd *Command, args []string)
|
||||
Run func(cmd *Command, args []string) int
|
||||
|
||||
// UsageLine is the one-line usage message.
|
||||
// The first word in the line is taken to be the command name.
|
||||
@ -110,8 +110,7 @@ func main() {
|
||||
cmd.Flag.Parse(args[1:])
|
||||
args = cmd.Flag.Args()
|
||||
}
|
||||
cmd.Run(cmd, args)
|
||||
os.Exit(2)
|
||||
os.Exit(cmd.Run(cmd, args))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user