refactor main
This commit is contained in:
parent
8a7d0f4982
commit
056ad2c4d5
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
src
|
||||
bin
|
||||
/src
|
||||
/bin
|
||||
/pkg
|
||||
/gowebdav
|
||||
|
21
Makefile
21
Makefile
@ -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
|
||||
|
@ -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>")
|
Loading…
Reference in New Issue
Block a user