Avoid printing hidden flags and commands with custom help. (#2015)

Always use .VisibleFlags and .VisibleCommands in templates
to avoid printing hidden flags and commands in the help
template.
This commit is contained in:
Harshavardhana
2017-02-15 02:05:29 -08:00
committed by GitHub
parent 43388a06ca
commit e7e44b96ee
33 changed files with 43 additions and 43 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ USAGE:
{{.HelpName}} ALIAS/BUCKET/PREFIX
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. List objects than need to be healed related to 'testbucket' in a Minio server represented by its alias 'play'.
+2 -2
View File
@@ -58,11 +58,11 @@ USAGE:
{{.HelpName}} [FLAGS] COMMAND
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}
EXAMPLES:
1. Heal 'testbucket' in a Minio server represented by its alias 'play'.
+1 -1
View File
@@ -50,7 +50,7 @@ USAGE:
{{.HelpName}} ALIAS/BUCKET/PREFIX
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Clear all locks hold by 'testbucket' in a Minio server represented by its alias 'play'.
+1 -1
View File
@@ -50,7 +50,7 @@ USAGE:
{{.HelpName}} ALIAS/BUCKET/PREFIX
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. List hold locks related to testbucket in a Minio server represented by its alias 'play'.
+2 -2
View File
@@ -39,10 +39,10 @@ USAGE:
{{.HelpName}} [FLAGS] COMMAND
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}
`,
}
+2 -2
View File
@@ -41,10 +41,10 @@ USAGE:
{{.HelpName}} [FLAGS] COMMAND
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}
`,
}
+1 -1
View File
@@ -37,7 +37,7 @@ USAGE:
{{.HelpName}} ALIAS ACCESS_KEY SECRET_KEY
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Set new credentials of a Minio server represented by its alias 'play'.
+1 -1
View File
@@ -38,7 +38,7 @@ USAGE:
{{.HelpName}} ALIAS
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Restart a Minio server represented by its alias 'play'.
+1 -1
View File
@@ -46,7 +46,7 @@ USAGE:
{{.HelpName}} ALIAS
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Get storage information of a Minio server represented by its alias 'play'.
+2 -2
View File
@@ -35,10 +35,10 @@ USAGE:
{{.HelpName}} [FLAGS] COMMAND
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}
`,
}
+1 -1
View File
@@ -46,7 +46,7 @@ USAGE:
{{.HelpName}} [FLAGS] SOURCE [SOURCE...]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Stream an object from Amazon S3 cloud storage to mplayer standard input.
+1 -1
View File
@@ -50,7 +50,7 @@ OPERATION:
list
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Add Amazon S3 storage service under "myphotos" alias. For security reasons turn off bash history momentarily.
+2 -2
View File
@@ -49,10 +49,10 @@ USAGE:
{{.HelpName}} [FLAGS] COMMAND
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}
`,
}
+1 -1
View File
@@ -58,7 +58,7 @@ USAGE:
{{.HelpName}} [FLAGS] SOURCE [SOURCE...] TARGET
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Copy a list of objects from local file system to Amazon S3 cloud storage.
+1 -1
View File
@@ -47,7 +47,7 @@ USAGE:
mc {{.Name}} [FLAGS] FIRST SECOND
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
DESCRIPTION:
{{.Description}}
+1 -1
View File
@@ -57,7 +57,7 @@ USAGE:
{{.HelpName}} ALIAS/BUCKET ARN [FLAGS]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Enable bucket notification with a specific arn
+1 -1
View File
@@ -43,7 +43,7 @@ USAGE:
{{.HelpName}} ALIAS/BUCKET ARN [FLAGS]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. List notification configurations associated to a specific arn
+2 -2
View File
@@ -40,10 +40,10 @@ USAGE:
{{.HelpName}} [FLAGS] COMMAND
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}
`,
}
+1 -1
View File
@@ -48,7 +48,7 @@ USAGE:
{{.HelpName}} ALIAS/BUCKET [ARN] [FLAGS]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Remove bucket notification associated to a specific arn
+1 -1
View File
@@ -52,7 +52,7 @@ USAGE:
{{.HelpName}} [FLAGS] TARGET [TARGET ...]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. List buckets on Amazon S3 cloud storage.
+4 -4
View File
@@ -43,13 +43,13 @@ var mcHelpTemplate = `NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.Name}} {{if .Flags}}[FLAGS] {{end}}COMMAND{{if .Flags}} [COMMAND FLAGS | -h]{{end}} [ARGUMENTS...]
{{.Name}} {{if .VisibleFlags}}[FLAGS] {{end}}COMMAND{{if .VisibleFlags}} [COMMAND FLAGS | -h]{{end}} [ARGUMENTS...]
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}{{if .Flags}}
{{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}{{if .VisibleFlags}}
GLOBAL FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}{{end}}
VERSION:
` + Version +
+1 -1
View File
@@ -49,7 +49,7 @@ USAGE:
{{.HelpName}} [FLAGS] TARGET [TARGET...]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Create a bucket on Amazon S3 cloud storage.
+1 -1
View File
@@ -78,7 +78,7 @@ USAGE:
{{.HelpName}} [FLAGS] SOURCE TARGET
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Mirror a bucket recursively from Minio cloud storage to a bucket on Amazon S3 cloud storage.
+1 -1
View File
@@ -42,7 +42,7 @@ USAGE:
{{.HelpName}} [FLAGS] [TARGET]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Write contents of stdin to a file on local filesystem.
+1 -1
View File
@@ -54,7 +54,7 @@ PERMISSION:
Allowed policies are: [none, download, upload, public].
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Set bucket to "download" on Amazon S3 cloud storage.
+1 -1
View File
@@ -76,7 +76,7 @@ USAGE:
{{.HelpName}} [FLAGS] TARGET [TARGET ...]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Remove a file.
+1 -1
View File
@@ -56,7 +56,7 @@ SESSION-ID:
SESSION - Session can either be $SESSION-ID or "all".
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. List sessions.
+1 -1
View File
@@ -47,7 +47,7 @@ USAGE:
{{.HelpName}} [OPTIONS] TARGET [TARGET...]
OPTIONS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Share this object with 7 days default expiry.
+2 -2
View File
@@ -48,10 +48,10 @@ USAGE:
{{.HelpName}} [FLAGS] COMMAND
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}
`,
}
+1 -1
View File
@@ -50,7 +50,7 @@ USAGE:
{{.HelpName}} [OPTIONS] TARGET [TARGET...]
OPTIONS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Generate a curl command to allow upload access for a single object. Command expires in 7 days (default).
+1 -1
View File
@@ -55,7 +55,7 @@ USAGE:
{{.HelpName}} [FLAGS]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Check for any new official release.
+1 -1
View File
@@ -44,7 +44,7 @@ USAGE:
{{.HelpName}} [FLAGS]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
`,
}
+1 -1
View File
@@ -67,7 +67,7 @@ USAGE:
{{.HelpName}} [FLAGS]
FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Watch new S3 operations on a minio server