func main() { kingpin.Version(Version) args, err := app.Parse(os.Args[1:]) switch kingpin.MustParse(args, err) { case appCheck.FullCommand(): if len(*serverIP) > 0 { remoteCheck() } else { jsonResults := []machine.CheckResult{} for i, check := range batten.Checks { results := batten.RunCheck(check) cli.FormatResultsForConsole(i, results) jsonCheck := machine.FormatResultsForMachine(i, results) jsonResults = append(jsonResults, jsonCheck) } jsonString := machine.JSONResult{ CheckResults: jsonResults, } machine.ShowResults(&jsonString) } default: app.Usage(os.Stdout) } }
func main() { kingpin.Version(Version) args, err := app.Parse(os.Args[1:]) switch kingpin.MustParse(args, err) { case appCheck.FullCommand(): for i, check := range batten.Checks { results := batten.RunCheck(check) cli.FormatResultsForConsole(i, results) } default: app.Usage(os.Stdout) } }