From 28bd8180aaad1c34d17790e81d923d641b907456 Mon Sep 17 00:00:00 2001 From: Daisuke Fujita Date: Fri, 25 Nov 2016 09:59:40 +0900 Subject: [PATCH 1/2] Work with -b and -k correctly --- main.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/main.go b/main.go index c63b540..924c18c 100644 --- a/main.go +++ b/main.go @@ -58,11 +58,6 @@ Options: f.Parse(f.Args()[1:]) } - if s3URL == "" { - f.Usage() - os.Exit(1) - } - var sess *session.Session var err error From f1bc582af3e654b7594b44c1907e385c15a656e9 Mon Sep 17 00:00:00 2001 From: Daisuke Fujita Date: Fri, 25 Nov 2016 10:06:31 +0900 Subject: [PATCH 2/2] Show usage if no argument or flag is given --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 924c18c..83025b9 100644 --- a/main.go +++ b/main.go @@ -73,6 +73,11 @@ Options: sess = session.New() } + if s3URL == "" && (bucket == "" || key == "") { + f.Usage() + os.Exit(1) + } + if s3URL != "" { bucket, key, err = parseURL(s3URL) if err != nil {