Merge pull request #29759 from allencloud/purify-error-message-for-create-and-run

purify error message in cli for create and run command
Upstream-commit: 96815a7dc4a117d36ff3294c651b2384467c4024
Component: engine
This commit is contained in:
Vincent Demeester
2017-01-17 16:53:51 +01:00
committed by GitHub
@@ -255,10 +255,11 @@ func runRun(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts *runOptions
// reportError is a utility method that prints a user-friendly message
// containing the error that occurred during parsing and a suggestion to get help
func reportError(stderr io.Writer, name string, str string, withHelp bool) {
str = strings.TrimSuffix(str, ".") + "."
if withHelp {
str += ".\nSee '" + os.Args[0] + " " + name + " --help'"
str += "\nSee '" + os.Args[0] + " " + name + " --help'."
}
fmt.Fprintf(stderr, "%s: %s.\n", os.Args[0], str)
fmt.Fprintf(stderr, "%s: %s\n", os.Args[0], str)
}
// if container start fails with 'not found'/'no such' error, return 127