Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/admin-heal-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
4 changes: 2 additions & 2 deletions cmd/admin-heal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin-lock-clear.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin-lock-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
4 changes: 2 additions & 2 deletions cmd/admin-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
`,
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/admin-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
`,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin-password.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin-service-restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ USAGE:
{{.HelpName}} ALIAS

FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Restart a Minio server represented by its alias 'play'.
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin-service-status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
4 changes: 2 additions & 2 deletions cmd/admin-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
`,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/cat-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/config-host-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cmd/config-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
`,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/cp-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/diff-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ USAGE:
mc {{.Name}} [FLAGS] FIRST SECOND

FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
DESCRIPTION:
{{.Description}}
Expand Down
2 changes: 1 addition & 1 deletion cmd/events-add.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/events-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cmd/events-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
`,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/events-remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/ls-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ USAGE:
{{.HelpName}} [FLAGS] TARGET [TARGET ...]

FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. List buckets on Amazon S3 cloud storage.
Expand Down
8 changes: 4 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand Down
2 changes: 1 addition & 1 deletion cmd/mb-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/mirror-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/pipe-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/policy-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/rm-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ USAGE:
{{.HelpName}} [FLAGS] TARGET [TARGET ...]

FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Remove a file.
Expand Down
2 changes: 1 addition & 1 deletion cmd/session-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/share-download-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cmd/share-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
`,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/share-upload-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion cmd/update-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ USAGE:
{{.HelpName}} [FLAGS]

FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Check for any new official release.
Expand Down
2 changes: 1 addition & 1 deletion cmd/version-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ USAGE:
{{.HelpName}} [FLAGS]

FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
`,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/watch-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ USAGE:
{{.HelpName}} [FLAGS]

FLAGS:
{{range .Flags}}{{.}}
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Watch new S3 operations on a minio server
Expand Down