fix flag parser
This commit is contained in:
parent
1cd7bd1100
commit
d8aaad0e18
@ -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()))
|
||||
|
Loading…
Reference in New Issue
Block a user