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:
Anis Elleuch
2016-11-28 21:15:36 +01:00
committed by Harshavardhana
parent 9ccfb70104
commit 01f625824a
5 changed files with 103 additions and 70 deletions

View File

@@ -265,8 +265,14 @@ func getReleaseUpdate(updateURL string, duration time.Duration) (updateMsg updat
// main entry point for update command.
func mainUpdate(ctx *cli.Context) {
// 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
}