Skip to content

Commit

Permalink
ref: make names more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
MrVine committed Dec 14, 2019
1 parent c4c7079 commit 321978f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmd/gowebdav/main.go
Expand Up @@ -15,8 +15,8 @@ import (

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]")
user := flag.String("user", os.Getenv("USER"), "User [ENV.USER]")
password := flag.String("pw", os.Getenv("PASSWORD"), "Password [ENV.PASSWORD]")
netrc := flag.String("netrc-file", filepath.Join(getHome(), ".netrc"), "read login from netrc file")
method := flag.String("X", "", `Method:
LS <PATH>
Expand All @@ -39,18 +39,18 @@ func main() {
fail("Set WebDAV ROOT")
}

if l := len(flag.Args()); l == 0 || l > 2 {
if argsLength := len(flag.Args()); argsLength == 0 || argsLength > 2 {
fail("Unsupported arguments")
}

if *pw == "" {
if *password == "" {
if u, p := d.ReadConfig(*root, *netrc); u != "" && p != "" {
usr = &u
pw = &p
user = &u
password = &p
}
}

c := d.NewClient(*root, *usr, *pw)
c := d.NewClient(*root, *user, *password)

cmd := getCmd(*method)

Expand Down

0 comments on commit 321978f

Please sign in to comment.