mirror of
https://github.com/pgsty/minio.git
synced 2026-07-22 21:50:22 +03:00
Add global flags to all commands and subcommands (#2605)
This commit is contained in:
committed by
Harshavardhana
parent
ff99392102
commit
3e284162d7
@@ -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/
|
||||
|
||||
Reference in New Issue
Block a user