mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
args: Honor config-dir & quiet wherever they are (#3356)
setGlobalsFromContext() is added to set global variables after parsing command line arguments. Thus, global flags will be honored wherever they are placed in minio command.
This commit is contained in:
committed by
Harshavardhana
parent
9ccfb70104
commit
01f625824a
+8
-2
@@ -43,8 +43,14 @@ func mainVersion(ctx *cli.Context) {
|
||||
if len(ctx.Args()) != 0 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "version", 1)
|
||||
}
|
||||
// Set global quiet flag.
|
||||
if ctx.Bool("quiet") || ctx.GlobalBool("quiet") {
|
||||
|
||||
// Set global variables after parsing passed arguments
|
||||
setGlobalsFromContext(ctx)
|
||||
|
||||
// Initialization routine, such as config loading, enable logging, ..
|
||||
minioInit()
|
||||
|
||||
if globalQuiet {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user