From d8aaad0e18edeb25bd90823f2193ba97be4c5f1f Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Fri, 24 Oct 2014 14:16:54 +0200 Subject: [PATCH] fix flag parser --- main/client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/client.go b/main/client.go index ddb93f7..54433c1 100644 --- a/main/client.go +++ b/main/client.go @@ -30,14 +30,16 @@ func main() { root := flag.String("root", "URL", "WebDAV Endpoint") usr := flag.String("user", "", "user") pw := flag.String("pw", "", "password") - mm := strings.ToUpper(*(flag.String("X", "GET", "Method ..."))) - m := &mm + m := flag.String("X", "GET", "Method ...") flag.Parse() if *root == "URL" { Fail(nil) } + M := strings.ToUpper(*m) + m = &M + c := d.NewClient(*root, *usr, *pw) if err := c.Connect(); err != nil { Fail(fmt.Sprintf("Failed to connect due to: %s", err.Error()))