1
0
mirror of https://github.com/minio/mc.git synced 2025-11-14 23:42:27 +03:00

Refactoring console printing style, supports --json even for error messages now - fixes #418

This commit is contained in:
Harshavardhana
2015-05-22 18:15:16 -07:00
parent 190afa70a1
commit 54d0f9c553
16 changed files with 428 additions and 270 deletions

View File

@@ -34,13 +34,19 @@ func runConfigCmd(ctx *cli.Context) {
arg := ctx.Args().First()
tailArgs := ctx.Args().Tail()
if len(tailArgs) > 2 {
console.Fatalln("Incorrect number of arguments, please use \"mc config help\"")
console.Fatalln(console.ErrorMessage{
Message: "Incorrect number of arguments, please use \"mc config help\"",
Error: iodine.New(errInvalidArgument{}, nil),
})
}
msg, err := doConfig(arg, tailArgs)
if err != nil {
console.Fatalln(msg)
console.Fatalln(console.ErrorMessage{
Message: msg,
Error: err,
})
}
console.Infoln(msg)
console.Infoln(console.Message(msg))
}
// saveConfig writes configuration data in json format to config file.