From 8f82edbcb3f43e39e037327ad39f4e660e11f20e Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 13 Mar 2019 13:49:39 -0600 Subject: Usage messages: deduplicate '(default true)' et al Remove hardcoded '(default: true)' strings from bool flags, and '(default this-or-that)' from string flags. First because it's unmaintainable duplication that would cause confusion should someone ever change the default and not notice the message. Second, because cobra[1] already prints '(default XXXX)' for all options with non-false non-nil default. So in each of these cases, current podman help behavior is: $ podman login --help ... --tls-verify Require HTTPS ... (default: true) (default true) This PR eliminates that duplication. [1] actually spf13/pflag/flag.go The only nontrivial one of these is start.go, where the default for sigProxy depends on the --attach flag. Solution: change the command-line default to false, and implement the new conditional default in logic. Bonus: removed unnecessary check, because now if sigProxy is set without --attach, we can guarantee that it was done by the user. But please pay close scrutiny to this particular section in case there's something I missed. Signed-off-by: Ed Santiago --- cmd/podman/runlabel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/podman/runlabel.go') diff --git a/cmd/podman/runlabel.go b/cmd/podman/runlabel.go index 68621e095..229ff1201 100644 --- a/cmd/podman/runlabel.go +++ b/cmd/podman/runlabel.go @@ -57,7 +57,7 @@ func init() { flags.BoolP("pull", "p", false, "Pull the image if it does not exist locally prior to executing the label contents") flags.BoolVarP(&runlabelCommand.Quiet, "quiet", "q", false, "Suppress output information when installing images") flags.StringVar(&runlabelCommand.SignaturePolicy, "signature-policy", "", "`Pathname` of signature policy file (not usually used)") - flags.BoolVar(&runlabelCommand.TlsVerify, "tls-verify", true, "Require HTTPS and verify certificates when contacting registries (default: true)") + flags.BoolVar(&runlabelCommand.TlsVerify, "tls-verify", true, "Require HTTPS and verify certificates when contacting registries") flags.MarkDeprecated("pull", "podman will pull if not found in local storage") } -- cgit v1.2.3-54-g00ecf