global alias option

This commit is contained in:
Anand Babu (AB) Periasamy
2015-05-30 17:49:08 -07:00
parent 0cacad1f20
commit fefdbd35ed
3 changed files with 11 additions and 5 deletions
+8 -4
View File
@@ -41,6 +41,14 @@ var commands = []cli.Command{
// Collection of mc flags currently supported
var (
flags = []cli.Flag{
cli.BoolFlag{
Name: "quiet, q",
Usage: "Supress chatty console output",
},
cli.BoolFlag{
Name: "alias",
Usage: "Mimic operating system toolchain behavior wherever it makes sense",
},
cli.StringFlag{
Name: "theme",
Value: console.GetDefaultThemeName(),
@@ -63,10 +71,6 @@ var (
Name: "debug",
Usage: "Enable HTTP tracing",
},
cli.BoolFlag{
Name: "quiet, q",
Usage: "Supress chatty console output",
},
// Add your new flags starting here
}
)
+2 -1
View File
@@ -18,9 +18,10 @@
package main
var (
globalDebugFlag = false // Debug flag set via command line
globalQuietFlag = false // Quiet flag set via command line
globalAliasFlag = false // Alias flag set via command line
globalJSONFlag = false // Json flag set via command line
globalDebugFlag = false // Debug flag set via command line
mcCurrentConfigVersion = "1.0.0"
)
+1
View File
@@ -107,6 +107,7 @@ func main() {
app.Author = "Minio.io"
app.Before = func(ctx *cli.Context) error {
globalQuietFlag = ctx.GlobalBool("quiet")
globalAliasFlag = ctx.GlobalBool("alias")
globalDebugFlag = ctx.GlobalBool("debug")
globalJSONFlag = ctx.GlobalBool("json")
if globalDebugFlag {