func ReportError(cmd *flag.FlagSet, str string, withHelp bool) { if withHelp { if os.Args[0] == cmd.Name() { str += ". See '" + os.Args[0] + " --help'" } else { str += ". See '" + os.Args[0] + " " + cmd.Name() + " --help'" } } fmt.Fprintf(cmd.Out(), "docker: %s.\n", str) os.Exit(1) }