mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
make bad flags exit with proper status code
This commit is contained in:
@ -36,7 +36,7 @@ var _ = cmd(catDebug, &cli.Command{
|
||||
})
|
||||
|
||||
// Run will execute the CLI
|
||||
func Run(v string) error {
|
||||
func Run(v string) int {
|
||||
version = v
|
||||
app := cli.NewApp()
|
||||
app.Version = version
|
||||
@ -46,8 +46,10 @@ func Run(v string) error {
|
||||
sort.Sort(cli.CommandsByName(commands))
|
||||
app.Commands = commands
|
||||
app.EnableBashCompletion = true
|
||||
app.Run(os.Args)
|
||||
return nil
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Shared config types
|
||||
|
Reference in New Issue
Block a user