Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 6812565

Browse files
committed
Use consistent name for errors
This prevents inconsistent errors when using a symlink, or when renaming the binary; Before this change; ln -s $(which docker) toto ./toto rune docker: 'rune' is not a docker command. ./toto run daslkjadslkjdaslkj Unable to find image 'adslkjadslakdsj:latest' locally ./toto: Error response from daemon: pull access denied for adslkjadslakdsj, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. After this change: ln -s $(which docker) toto ./toto rune docker: 'rune' is not a docker command. ./toto run daslkjadslkjdaslkj Unable to find image 'adslkjadslakdsj:latest' locally docker: Error response from daemon: pull access denied for adslkjadslakdsj, repository does not exist or may require 'docker login': denied: requested access to the resource is den> Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit a3af1f47da75d5b0ca94a1f0f24d8d2028073c4e) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 936d328da9af334147b9fcb4448b8f2140cfeffb Component: cli
1 parent 962e636 commit 6812565

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • components/cli/cli/command/container

components/cli/cli/command/container/run.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"fmt"
66
"io"
7-
"os"
87
"runtime"
98
"strings"
109
"syscall"
@@ -280,9 +279,9 @@ func attachContainer(
280279
func reportError(stderr io.Writer, name string, str string, withHelp bool) {
281280
str = strings.TrimSuffix(str, ".") + "."
282281
if withHelp {
283-
str += "\nSee '" + os.Args[0] + " " + name + " --help'."
282+
str += "\nSee 'docker " + name + " --help'."
284283
}
285-
fmt.Fprintf(stderr, "%s: %s\n", os.Args[0], str)
284+
fmt.Fprintln(stderr, "docker:", str)
286285
}
287286

288287
// if container start fails with 'not found'/'no such' error, return 127

0 commit comments

Comments
 (0)