Skip to content

Commit

Permalink
* Add a success message to subcommand "check"
Browse files Browse the repository at this point in the history
  • Loading branch information
tlimoncelli committed Sep 15, 2017
1 parent a520a24 commit 7c015bd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions commands/printIR.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,21 @@ var _ = cmd(catDebug, func() *cli.Command {

var _ = cmd(catDebug, func() *cli.Command {
var args PrintIRArgs
// This is the same as print-ir but output defaults to /dev/null.
// This is the same as print-ir with the following changes:
// - output defaults to /dev/null.
// - prints "No errors." if there were no errors.
return &cli.Command{
Name: "check",
Usage: "Check and validate dnsconfig.js. Do not access providers.",
Action: func(c *cli.Context) error {
if args.Output == "" {
args.Output = os.DevNull
}
return exit(PrintIR(args))
err := exit(PrintIR(args))
if err == nil {
fmt.Fprintf(os.Stderr, "No errors.\n")
}
return err
},
Flags: args.flags(),
}
Expand Down

0 comments on commit 7c015bd

Please sign in to comment.