Merge pull request #282 from abperiasamy/show-cmd-help-no-arg

show help when no args are passed
This commit is contained in:
Anand Babu (AB) Periasamy
2015-04-09 14:38:29 -07:00
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -59,6 +59,10 @@ func printObject(date time.Time, v int64, key string) {
func doListCmd(ctx *cli.Context) {
var items []*client.Item
if len(ctx.Args()) < 1 {
cli.ShowCommandHelpAndExit(ctx, "ls", 1) // last argument is exit code
}
urlStr, err := parseURL(ctx.Args().First())
if err != nil {
log.Debug.Println(iodine.New(err, nil))
+4
View File
@@ -25,6 +25,10 @@ import (
// doMakeBucketCmd creates a new bucket
func doMakeBucketCmd(ctx *cli.Context) {
if len(ctx.Args()) < 1 {
cli.ShowCommandHelpAndExit(ctx, "mb", 1) // last argument is exit code
}
urlStr, err := parseURL(ctx.Args().First())
if err != nil {
log.Debug.Println(iodine.New(err, nil))