diff --git a/a_test.go b/a_test.go new file mode 100644 index 0000000000..022978387f --- /dev/null +++ b/a_test.go @@ -0,0 +1,10 @@ +package docker + +import ( + "os" + "testing" +) + +func Test(t *testing.T) { + os.Setenv("TEST", "1") +} diff --git a/container.go b/container.go index 9099d90f6f..39c19c53d4 100644 --- a/container.go +++ b/container.go @@ -107,7 +107,7 @@ type KeyValuePair struct { func ParseRun(args []string, capabilities *Capabilities) (*Config, *HostConfig, *flag.FlagSet, error) { cmd := Subcmd("run", "[OPTIONS] IMAGE [COMMAND] [ARG...]", "Run a command in a new container") - if len(args) > 0 && args[0] != "--help" { + if os.Getenv("TEST") != "" { cmd.SetOutput(ioutil.Discard) cmd.Usage = nil }