cli: Add new features from CLI.

use `.HelpName` for template to pass down
proper command names. Also treat flags
to be optional in all of them.
This commit is contained in:
Harshavardhana
2017-02-15 17:45:08 -08:00
parent 25eeb88a8f
commit 611bd68739
4 changed files with 15 additions and 28 deletions

View File

@@ -37,24 +37,20 @@ var updateCmd = cli.Command{
Usage: "Check for a new software update.",
Action: mainUpdate,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Show this help.",
},
cli.BoolFlag{
Name: "quiet",
Usage: "Disable any update messages.",
},
},
CustomHelpTemplate: `Name:
minio {{.Name}} - {{.Usage}}
{{.HelpName}} - {{.Usage}}
USAGE:
minio {{.Name}} [FLAGS]
{{.HelpName}} {{if .VisibleFlags}}[FLAGS]{{end}}
{{if .VisibleFlags}}
FLAGS:
{{range .VisibleFlags}}{{.}}
{{end}}
{{end}}{{end}}
EXIT STATUS:
0 - You are already running the most recent version.
1 - New update is available.