From 13c3b9cbcb089bed1557bd5d82bd3f6dfa9817de Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 15 Feb 2017 02:25:38 -0800 Subject: [PATCH] main/cli: Don't print hidden flags/commands in help template. (#3748) Always use .VisibleFlags and .VisibleCommands to not print Hidden flags as expected from help template. --- cmd/main.go | 8 ++++---- cmd/server-main.go | 2 +- cmd/update-main.go | 2 +- cmd/version-main.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 994e77d80..f490d2582 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -53,13 +53,13 @@ DESCRIPTION: {{.Description}} USAGE: - minio {{if .Flags}}[flags] {{end}}command{{if .Flags}}{{end}} [arguments...] + minio {{if .VisibleFlags}}[flags] {{end}}command{{if .VisibleFlags}}{{end}} [arguments...] COMMANDS: - {{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}} - {{end}}{{if .Flags}} + {{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}} + {{end}}{{if .VisibleFlags}} FLAGS: - {{range .Flags}}{{.}} + {{range .VisibleFlags}}{{.}} {{end}}{{end}} VERSION: ` + Version + diff --git a/cmd/server-main.go b/cmd/server-main.go index 6b4deca7f..f48f90d07 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -52,7 +52,7 @@ USAGE: minio {{.Name}} [FLAGS] PATH [PATH...] FLAGS: - {{range .Flags}}{{.}} + {{range .VisibleFlags}}{{.}} {{end}} ENVIRONMENT VARIABLES: ACCESS: diff --git a/cmd/update-main.go b/cmd/update-main.go index 4198506d3..4876f9849 100644 --- a/cmd/update-main.go +++ b/cmd/update-main.go @@ -53,7 +53,7 @@ USAGE: minio {{.Name}} [FLAGS] FLAGS: - {{range .Flags}}{{.}} + {{range .VisibleFlags}}{{.}} {{end}} EXIT STATUS: 0 - You are already running the most recent version. diff --git a/cmd/version-main.go b/cmd/version-main.go index 80370332a..0ca92c52b 100644 --- a/cmd/version-main.go +++ b/cmd/version-main.go @@ -38,7 +38,7 @@ USAGE: minio {{.Name}} FLAGS: - {{range .Flags}}{{.}} + {{range .VisibleFlags}}{{.}} {{end}} VERSION: ` + Version + `{{"\n"}}`,