Use Args in cobra.Command to validate args.

Also re-use context.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: fc5a4514fbe1b402d2a0bff170486ac3de4bf8cc
Component: engine
This commit is contained in:
Daniel Nephin
2016-05-31 15:43:16 -07:00
parent 354491fd5d
commit 93473dcef1
7 changed files with 33 additions and 41 deletions
@@ -335,7 +335,7 @@ func testCommand(cmd string, newEnvs []string, scanForHome bool, home string) er
return fmt.Errorf("Should not have full usage on %q\n", args)
}
if strings.HasSuffix(stderr, "\n\n") {
return fmt.Errorf("Should not have a blank line on %q\n", args)
return fmt.Errorf("Should not have a blank line on %q\n%v", args, stderr)
}
}