Merge pull request #282 from abperiasamy/show-cmd-help-no-arg
show help when no args are passed
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user