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
+11 -2
View File
@@ -27,11 +27,20 @@ import (
var (
// global flags for minio.
minioFlags = []cli.Flag{
globalFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Show help.",
},
cli.StringFlag{
Name: "config-dir, C",
Value: mustGetConfigPath(),
Usage: "Path to configuration folder.",
},
cli.BoolFlag{
Name: "quiet",
Usage: "Suppress chatty output.",
},
}
)
@@ -115,7 +124,7 @@ func registerApp() *cli.App {
app.Author = "Minio.io"
app.Usage = "Cloud Storage Server."
app.Description = `Minio is an Amazon S3 compatible object storage server. Use it to store photos, videos, VMs, containers, log files, or any blob of data as objects.`
app.Flags = append(minioFlags, globalFlags...)
app.Flags = globalFlags
app.Commands = commands
app.CustomAppHelpTemplate = minioHelpTemplate
app.CommandNotFound = func(ctx *cli.Context, command string) {