Add global flags to all commands and subcommands (#2605)

This commit is contained in:
Anis Elleuch
2016-09-01 23:12:49 +01:00
committed by Harshavardhana
parent ff99392102
commit 3e284162d7
9 changed files with 62 additions and 40 deletions
+12 -6
View File
@@ -23,22 +23,28 @@ import (
"github.com/minio/cli"
)
var shutdownFlags = []cli.Flag{
cli.BoolFlag{
Name: "restart",
Usage: "Restart the server.",
},
}
var shutdownCmd = cli.Command{
Name: "shutdown",
Usage: "Shutdown or restart the server.",
Action: shutdownControl,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "restart",
Usage: "Restart the server.",
},
},
Flags: append(shutdownFlags, globalFlags...),
CustomHelpTemplate: `NAME:
minio control {{.Name}} - {{.Usage}}
USAGE:
minio control {{.Name}} http://localhost:9000/
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Shutdown the server:
$ minio control shutdown http://localhost:9000/