From aeaf8d40551b6ffdc9380d8c38049b5116d690c6 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 21 May 2015 18:08:12 -0700 Subject: [PATCH] Reorder options, print only error messages --- cmd-options.go | 32 +++++++++++++++----------------- pkg/console/console.go | 6 +++--- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/cmd-options.go b/cmd-options.go index cb017a99..63210c78 100644 --- a/cmd-options.go +++ b/cmd-options.go @@ -316,24 +316,22 @@ EXAMPLES: // Collection of mc commands currently supported are // -// ---- -// ls List files and objects -// cp Copy objects and files from multiple sources to single destination -// sync Copy objects and files from single source to multiple destionations -// mb Make a bucket -// access Set permissions [public, private, readonly, authenticated] for buckets and folders. -// cat Concantenate an object to standard output -// config Generate configuration "/home/harsha/.mc/config.json" file. -// update Check for new software updates -// ---- +// ls List files and objects +// cp Copy objects and files from multiple sources to single destination +// sync Copy objects and files from single source to multiple destionations +// mb Make a bucket +// access Set permissions [public, private, readonly, authenticated] for buckets and folders. +// cat Concantenate an object to standard output +// config Generate configuration "/home/harsha/.mc/config.json" file. +// update Check for new software updates // var commands = []cli.Command{ lsCmd, + mbCmd, + catCmd, cpCmd, syncCmd, diffCmd, - catCmd, - mbCmd, accessCmd, configCmd, updateCmd, @@ -342,11 +340,11 @@ var commands = []cli.Command{ // Collection of mc flags currently supported // -// --theme "minimal"Choose a console theme from this list [*minimal*, nocolor, white] -// --debug Enable HTTP tracing -// --quiet, -q Supress chatty console output -// --retry "5" Number of retry count -// --version, -v print the version +// --theme "minimal"Choose a console theme from this list [*minimal*, nocolor, white] +// --debug Enable HTTP tracing +// --quiet, -q Supress chatty console output +// --retry "5" Number of retry count +// --version, -v print the version // var ( flags = []cli.Flag{ diff --git a/pkg/console/console.go b/pkg/console/console.go index f3081e48..f532ce51 100644 --- a/pkg/console/console.go +++ b/pkg/console/console.go @@ -55,11 +55,11 @@ var ( Printf = themesDB[currThemeName].Info.Printf // Fatal prints a error message and exits - Fatal = func(a ...interface{}) { print(themesDB[currThemeName].Fatal, a...); os.Exit(1) } + Fatal = func(a ...interface{}) { print(themesDB[currThemeName].Error, a...); os.Exit(1) } // Fatalln prints a error message with a new line and exits - Fatalln = func(a ...interface{}) { println(themesDB[currThemeName].Fatal, a...); os.Exit(1) } + Fatalln = func(a ...interface{}) { println(themesDB[currThemeName].Error, a...); os.Exit(1) } // Fatalf prints a error message with formatting and exits - Fatalf = func(f string, a ...interface{}) { printf(themesDB[currThemeName].Fatal, f, a...); os.Exit(1) } + Fatalf = func(f string, a ...interface{}) { printf(themesDB[currThemeName].Error, f, a...); os.Exit(1) } // Error prints a error message Error = func(a ...interface{}) { print(themesDB[currThemeName].Error, a...) }