reorganize files

This commit is contained in:
Celogeek 2021-12-12 16:29:29 +01:00
parent 803225280c
commit 188efdbfa1
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A
4 changed files with 19 additions and 5 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
bin

View File

@ -1,3 +1,15 @@
build:
go build -o imgcat
all: build
.DEFAULT_GOAL := all
DIST=./bin
SRC=./cmd
BINARY=$(DIST)/imgcat
BINARY_SRC=$(SRC)/imgcat
SOURCE=$(shell find $(BINARY_SRC) -name "*.go")
$(BINARY): $(SOURCE)
go build -trimpath -o $(BINARY) $(BINARY_SRC)
all: $(BINARY) test
test:
$(BINARY) -url "https://images.pexels.com/photos/2558605/pexels-photo-2558605.jpeg?cs=srgb&dl=pexels-anel-rossouw-2558605.jpg&fm=jpg" -height 25

View File

@ -15,13 +15,13 @@ make
Or directly
```
go build -o imgcat
go build -trimpath -o ./bin/imgcat ./cmd/imgcat
```
## Usage
```
./imgcat -url "https://images.pexels.com/photos/2558605/pexels-photo-2558605.jpeg?cs=srgb&dl=pexels-anel-rossouw-2558605.jpg&fm=jpg" -height 25
./bin/imgcat -url "https://images.pexels.com/photos/2558605/pexels-photo-2558605.jpeg?cs=srgb&dl=pexels-anel-rossouw-2558605.jpg&fm=jpg" -height 25
```
<img width="1069" alt="Capture décran 2021-12-11 à 17 40 55" src="https://user-images.githubusercontent.com/65178/145684510-39617c22-5818-4573-896c-7e0e6915db91.png">

View File

@ -66,5 +66,6 @@ func main() {
PrintHeader(resp.ContentLength, opts.height)
PrintImg(resp.Body)
PrintFooter()
}