refactor main

This commit is contained in:
Christoph Polcin 2018-05-16 12:23:42 +02:00
parent 8a7d0f4982
commit 056ad2c4d5
3 changed files with 14 additions and 15 deletions

6
.gitignore vendored
View File

@ -1,2 +1,4 @@
src
bin
/src
/bin
/pkg
/gowebdav

View File

@ -1,20 +1,17 @@
SRC := $(wildcard *.go) main/client.go
BIN := bin
CLIENT := ${BIN}/client
BIN := gowebdav
SRC := $(wildcard *.go) cmd/gowebdav/main.go
all: test client
all: test cmd
client: ${CLIENT}
cmd: ${BIN}
${CLIENT}: ${SRC}
@echo build $@
go build -o $@ -- main/client.go
${BIN}: ${SRC}
go build -o $@ ./cmd/gowebdav
test:
go test
go test ./...
clean:
@echo clean ${BIN}
@rm -f ${BIN}/*
@rm -f ${BIN}
.PHONY: all client clean
.PHONY: all cmd clean test

View File

@ -14,7 +14,7 @@ func fail(err interface{}) {
if err != nil {
fmt.Println(err)
} else {
fmt.Println("Usage: client FLAGS ARGS")
fmt.Println("Usage: gowebdav FLAGS ARGS")
fmt.Println("Flags:")
flag.PrintDefaults()
fmt.Println("Method <ARGS>")