mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 04:00:25 +03:00
Add global flags to all commands and subcommands (#2605)
This commit is contained in:
committed by
Harshavardhana
parent
ff99392102
commit
3e284162d7
+11
-1
@@ -25,15 +25,25 @@ var versionCmd = cli.Command{
|
||||
Name: "version",
|
||||
Usage: "Print version.",
|
||||
Action: mainVersion,
|
||||
Flags: globalFlags,
|
||||
CustomHelpTemplate: `NAME:
|
||||
minio {{.Name}} - {{.Usage}}
|
||||
|
||||
USAGE:
|
||||
minio {{.Name}} {{if .Description}}
|
||||
minio {{.Name}}
|
||||
|
||||
FLAGS:
|
||||
{{range .Flags}}{{.}}
|
||||
{{end}}
|
||||
|
||||
`,
|
||||
}
|
||||
|
||||
func mainVersion(ctx *cli.Context) {
|
||||
if len(ctx.Args()) != 0 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "version", 1)
|
||||
}
|
||||
|
||||
console.Println("Version: " + Version)
|
||||
console.Println("Release-Tag: " + ReleaseTag)
|
||||
console.Println("Commit-ID: " + CommitID)
|
||||
|
||||
Reference in New Issue
Block a user