From 2791c2ec2812855760f01f5c50d9bb92d445ac62 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 3 Aug 2016 12:20:46 -0400 Subject: [PATCH] Fix tests and windows service. Support args to RunCommand Fix docker help text test. Fix for ipv6 tests. Fix TLSverify option. Fix TestDaemonDiscoveryBackendConfigReload Use tempfile for another test. Restore missing flag. Fix tests for removal of shlex. Signed-off-by: Daniel Nephin --- cobra.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cobra.go b/cobra.go index 5e20c96003..f924e67b27 100644 --- a/cobra.go +++ b/cobra.go @@ -28,7 +28,10 @@ func FlagErrorFunc(cmd *cobra.Command, err error) error { if cmd.HasSubCommands() { usage = "\n\n" + cmd.UsageString() } - return fmt.Errorf("%s\nSee '%s --help'.%s", err, cmd.CommandPath(), usage) + return StatusError{ + Status: fmt.Sprintf("%s\nSee '%s --help'.%s", err, cmd.CommandPath(), usage), + StatusCode: 125, + } } var usageTemplate = `Usage: {{if not .HasSubCommands}}{{.UseLine}}{{end}}{{if .HasSubCommands}}{{ .CommandPath}} COMMAND{{end}}