refactor main
This commit is contained in:
parent
8a7d0f4982
commit
056ad2c4d5
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
src
|
/src
|
||||||
bin
|
/bin
|
||||||
|
/pkg
|
||||||
|
/gowebdav
|
||||||
|
21
Makefile
21
Makefile
@ -1,20 +1,17 @@
|
|||||||
SRC := $(wildcard *.go) main/client.go
|
BIN := gowebdav
|
||||||
BIN := bin
|
SRC := $(wildcard *.go) cmd/gowebdav/main.go
|
||||||
CLIENT := ${BIN}/client
|
|
||||||
|
|
||||||
all: test client
|
all: test cmd
|
||||||
|
|
||||||
client: ${CLIENT}
|
cmd: ${BIN}
|
||||||
|
|
||||||
${CLIENT}: ${SRC}
|
${BIN}: ${SRC}
|
||||||
@echo build $@
|
go build -o $@ ./cmd/gowebdav
|
||||||
go build -o $@ -- main/client.go
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test
|
go test ./...
|
||||||
|
|
||||||
clean:
|
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 {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("Usage: client FLAGS ARGS")
|
fmt.Println("Usage: gowebdav FLAGS ARGS")
|
||||||
fmt.Println("Flags:")
|
fmt.Println("Flags:")
|
||||||
flag.PrintDefaults()
|
flag.PrintDefaults()
|
||||||
fmt.Println("Method <ARGS>")
|
fmt.Println("Method <ARGS>")
|
Loading…
Reference in New Issue
Block a user