diff --git a/README.md b/README.md index 73fa3c9..45c5c41 100644 --- a/README.md +++ b/README.md @@ -14,26 +14,30 @@ go get -u github.com/studio-b12/gowebdav/cmd/gowebdav ## Usage ```sh -Usage: gowebdav FLAGS ARGS -Flags: +$ gowebdav --help +Usage of gowebdav -X string - Method (default "GET") + Method: + LS + STAT + + MKDIR + MKDIRALL + + GET + PUT + + MV + CP + + DEL + -pw string Password [ENV.PASSWORD] -root string WebDAV Endpoint [ENV.ROOT] -user string User [ENV.USER] -Method - LS | LIST | PROPFIND - STAT - RM | DELETE | DEL - MKDIR | MKCOL - MKDIRALL | MKCOLALL - MV | MOVE | RENAME - CP | COPY - GET | PULL | READ - PUT | PUSH | WRITE ``` *Example* diff --git a/cmd/gowebdav/main.go b/cmd/gowebdav/main.go index ff6b313..84a2f62 100644 --- a/cmd/gowebdav/main.go +++ b/cmd/gowebdav/main.go @@ -14,7 +14,21 @@ func main() { root := flag.String("root", os.Getenv("ROOT"), "WebDAV Endpoint [ENV.ROOT]") usr := flag.String("user", os.Getenv("USER"), "User [ENV.USER]") pw := flag.String("pw", os.Getenv("PASSWORD"), "Password [ENV.PASSWORD]") - m := flag.String("X", "GET", "Method") + m := flag.String("X", "", `Method: + LS + STAT + + MKDIR + MKDIRALL + + GET + PUT + + MV + CP + + DEL + `) flag.Parse() if *root == "" { @@ -67,7 +81,7 @@ func getCmd(method string) func(c *d.Client, p0, p1 string) error { case "MKCOL", "MKDIR": return cmdMkdir - case "MKCOLALL", "MKDIRALL": + case "MKCOLALL", "MKDIRALL", "MKDIRP": return cmdMkdirAll case "RENAME", "MV", "MOVE":