From a53b909fcd9c868b86ded12065ee19cf3b0af8a3 Mon Sep 17 00:00:00 2001 From: Bala FA Date: Mon, 13 Feb 2017 13:54:34 +0530 Subject: [PATCH] mainVersion: Remove minio init and quiet handling (#3739) --- cmd/version-main.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/cmd/version-main.go b/cmd/version-main.go index 9ed543842..80370332a 100644 --- a/cmd/version-main.go +++ b/cmd/version-main.go @@ -1,5 +1,5 @@ /* - * Minio Cloud Storage, (C) 2015 Minio, Inc. + * Minio Cloud Storage, (C) 2015, 2016, 2017 Minio, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,12 @@ var versionCmd = cli.Command{ Name: "version", Usage: "Print version.", Action: mainVersion, - Flags: globalFlags, + Flags: []cli.Flag{ + cli.BoolFlag{ + Name: "help, h", + Usage: "Show this help.", + }, + }, CustomHelpTemplate: `NAME: minio {{.Name}} - {{.Usage}} @@ -35,8 +40,8 @@ USAGE: FLAGS: {{range .Flags}}{{.}} {{end}} - -`, +VERSION: + ` + Version + `{{"\n"}}`, } func mainVersion(ctx *cli.Context) { @@ -44,13 +49,6 @@ func mainVersion(ctx *cli.Context) { cli.ShowCommandHelpAndExit(ctx, "version", 1) } - // Initialization routine, such as config loading, enable logging, .. - minioInit(ctx) - - if globalQuiet { - return - } - console.Println("Version: " + Version) console.Println("Release-Tag: " + ReleaseTag) console.Println("Commit-ID: " + CommitID)