mirror of https://github.com/docker/cli.git
display message improve in run
Signed-off-by: Lifubang <lifubang@acmcoder.com>
This commit is contained in:
parent
b9a1a21fe2
commit
bb3820b26d
|
@ -316,7 +316,10 @@ func attachContainer(
|
||||||
// reportError is a utility method that prints a user-friendly message
|
// reportError is a utility method that prints a user-friendly message
|
||||||
// containing the error that occurred during parsing and a suggestion to get help
|
// containing the error that occurred during parsing and a suggestion to get help
|
||||||
func reportError(stderr io.Writer, name string, str string, withHelp bool) {
|
func reportError(stderr io.Writer, name string, str string, withHelp bool) {
|
||||||
str = strings.TrimSuffix(str, ".") + "."
|
puncRegexp := regexp.MustCompile(`[\n\r\!\.\?]$`)
|
||||||
|
if !puncRegexp.MatchString(str) {
|
||||||
|
str += "."
|
||||||
|
}
|
||||||
if withHelp {
|
if withHelp {
|
||||||
str += "\nSee '" + os.Args[0] + " " + name + " --help'."
|
str += "\nSee '" + os.Args[0] + " " + name + " --help'."
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue