示例#1
0
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)
	}
}
示例#2
0
文件: batten.go 项目: jerbia/batten
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)
	}

}