mirror of
https://github.com/celogeek/imgcat.git
synced 2025-05-24 15:52:38 +02:00
reorganize files
This commit is contained in:
parent
803225280c
commit
188efdbfa1
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
bin
|
18
Makefile
18
Makefile
@ -1,3 +1,15 @@
|
|||||||
build:
|
.DEFAULT_GOAL := all
|
||||||
go build -o imgcat
|
|
||||||
all: build
|
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
|
@ -15,13 +15,13 @@ make
|
|||||||
|
|
||||||
Or directly
|
Or directly
|
||||||
```
|
```
|
||||||
go build -o imgcat
|
go build -trimpath -o ./bin/imgcat ./cmd/imgcat
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## 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">
|
<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">
|
||||||
|
@ -66,5 +66,6 @@ func main() {
|
|||||||
|
|
||||||
PrintHeader(resp.ContentLength, opts.height)
|
PrintHeader(resp.ContentLength, opts.height)
|
||||||
PrintImg(resp.Body)
|
PrintImg(resp.Body)
|
||||||
|
|
||||||
PrintFooter()
|
PrintFooter()
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user