Skip to content

Commit 43a5352

Browse files
Merge pull request #97 from digitalghost-dev/0.11.1
0.11.1
2 parents 9f9690a + ddb2734 commit 43a5352

File tree

10 files changed

+63
-24
lines changed

10 files changed

+63
-24
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626
- main
2727

2828
env:
29-
VERSION_NUMBER: 'v0.11.0'
29+
VERSION_NUMBER: 'v0.11.1'
3030
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
3131
AWS_REGION: 'us-west-2'
3232

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ builds:
1414
- windows
1515
- darwin
1616
ldflags:
17-
- -s -w -X main.version=v0.11.0
17+
- -s -w -X main.version=v0.11.1
1818

1919
archives:
2020
- format: tar.gz

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN go mod download
88

99
COPY . .
1010

11-
RUN go build -ldflags "-X main.version=v0.11.0" -o poke-cli .
11+
RUN go build -ldflags "-X main.version=v0.11.1" -o poke-cli .
1212

1313
# build 2
1414
FROM gcr.io/distroless/static-debian12:nonroot

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img height="250" width="350" src="pokemon.svg" alt="pokemon-logo"/>
33
<h1>Pokémon CLI</h1>
44
<img src="https://img.shields.io/github/v/release/digitalghost-dev/poke-cli?style=flat-square&logo=git&logoColor=FFCC00&label=Release%20Version&labelColor=EEE&color=FFCC00" alt="version-label">
5-
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v0.11.0?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
5+
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v0.11.1?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
66
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/ci.yml?branch=main&style=flat-square&logo=github&logoColor=FFCC00&label=CI&labelColor=EEE&color=FFCC00" alt="ci-status-badge">
77
</div>
88
<div align="center">
@@ -19,7 +19,7 @@ My aim is to have five commands finished for `v1.0.0`. Read more in the [Roadmap
1919

2020
---
2121
## Demo
22-
![demo](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/demo-v0.10.0.gif)
22+
![demo](https://poke-cli-s3-bucket.s3.us-west-2.amazonaws.com/demo-v0.11.1.gif)
2323

2424
---
2525
## Install
@@ -68,7 +68,7 @@ _Use a Docker Image_
6868
* Necessary.
6969

7070
```bash
71-
docker run --rm -i -t digitalghostdev/poke-cli:v0.11.0 <command> [subcommand] flag]
71+
docker run --rm -i -t digitalghostdev/poke-cli:v0.11.1 <command> [subcommand] flag]
7272
```
7373

7474
### Go Install
@@ -121,7 +121,7 @@ _Not 100% up-to-date, may add or remove some of these choices_
121121
- [x] `natures`: get data about natures.
122122
- [ ] `pokemon`: get data about a specific Pokémon.
123123
- [x] `-a | --abilities`: display the Pokémon's abilities.
124-
- [ ] `-i | --image`: display a pixel image of the Pokémon.
124+
- [x] `-i | --image`: display a pixel image of the Pokémon.
125125
- [x] `-s | --stats`: display the Pokémon's base stats.
126126
- [x] `-t | --types`: display the Pokémon's typing.
127127
- [ ] `-m | --moves`: display learnable moves.

cli_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func TestRunCLI(t *testing.T) {
170170
{
171171
name: "Latest Flag",
172172
args: []string{"-l"},
173-
expectedOutput: "Latest Docker image version: v0.10.0\nLatest release tag: v0.10.0\n",
173+
expectedOutput: "Latest Docker image version: v0.11.0\nLatest release tag: v0.11.0\n",
174174
expectedCode: 0,
175175
},
176176
}

cmd/pokemon.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,28 @@ func PokemonCommand() {
3535
fmt.Println(helpMessage)
3636
}
3737

38-
flag.Parse()
39-
4038
pokeFlags, abilitiesFlag, shortAbilitiesFlag, imageFlag, shortImageFlag, statsFlag, shortStatsFlag, typesFlag, shortTypesFlag := flags.SetupPokemonFlagSet()
4139

4240
args := os.Args
4341

42+
// Pre-parse validation for empty image flag values
43+
for _, arg := range args {
44+
if strings.HasPrefix(arg, "-i=") && len(arg) == 3 {
45+
fmt.Println(errorBorder.Render(errorColor.Render("Error!"), "\nThe image flag (-i or --image) requires a non-empty value.\nValid sizes are: lg, md, sm."))
46+
os.Exit(1)
47+
}
48+
if strings.HasPrefix(arg, "--image=") && len(arg) == 8 {
49+
fmt.Println(errorBorder.Render(errorColor.Render("Error!"), "\nThe image flag (-i or --image) requires a non-empty value.\nValid sizes are: lg, md, sm."))
50+
os.Exit(1)
51+
}
52+
if strings.HasPrefix(arg, "-image=") && len(arg) == 7 {
53+
fmt.Println(errorBorder.Render(errorColor.Render("Error!"), "\nThe image flag (-i or --image) requires a non-empty value.\nValid sizes are: lg, md, sm."))
54+
os.Exit(1)
55+
}
56+
}
57+
58+
flag.Parse()
59+
4460
err := ValidatePokemonArgs(args)
4561
if err != nil {
4662
fmt.Println(err.Error())

demo.gif

5.04 KB
Loading

demo.tape

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Require echo
6262
Set Shell "bash"
6363
Set FontSize 32
6464
Set Width 2100
65-
Set Height 1100
65+
Set Height 1300
6666
Set TypingSpeed 85ms
6767

6868
Type "poke-cli pokemon charizard --abilities --stats --types"
@@ -77,6 +77,18 @@ Type clear
7777

7878
Enter
7979

80+
Type "poke-cli pokemon tyranitar --image=sm"
81+
82+
Sleep 3s
83+
84+
Enter
85+
86+
Sleep 5s
87+
88+
Type clear
89+
90+
Enter
91+
8092
Type "poke-cli types"
8193

8294
Sleep 3s

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ go 1.23.2
44

55
require (
66
github.com/charmbracelet/bubbles v0.20.0
7-
github.com/charmbracelet/bubbletea v1.2.0
7+
github.com/charmbracelet/bubbletea v1.2.4
88
github.com/charmbracelet/lipgloss v1.0.0
9-
github.com/charmbracelet/x/term v0.2.0
9+
github.com/charmbracelet/x/term v0.2.1
1010
github.com/disintegration/imaging v1.6.2
1111
github.com/lucasb-eyer/go-colorful v1.2.0
12-
github.com/stretchr/testify v1.9.0
13-
golang.org/x/text v0.19.0
12+
github.com/stretchr/testify v1.10.0
13+
golang.org/x/text v0.21.0
1414
)
1515

1616
require (
1717
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
18-
github.com/charmbracelet/x/ansi v0.4.5 // indirect
18+
github.com/charmbracelet/x/ansi v0.6.0 // indirect
1919
github.com/davecgh/go-spew v1.1.1 // indirect
2020
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
2121
github.com/mattn/go-isatty v0.0.20 // indirect
@@ -26,8 +26,8 @@ require (
2626
github.com/muesli/termenv v0.15.2 // indirect
2727
github.com/pmezard/go-difflib v1.0.0 // indirect
2828
github.com/rivo/uniseg v0.4.7 // indirect
29-
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 // indirect
30-
golang.org/x/sync v0.8.0 // indirect
31-
golang.org/x/sys v0.26.0 // indirect
29+
golang.org/x/image v0.23.0 // indirect
30+
golang.org/x/sync v0.10.0 // indirect
31+
golang.org/x/sys v0.29.0 // indirect
3232
gopkg.in/yaml.v3 v3.0.1 // indirect
3333
)

go.sum

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQW
66
github.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU=
77
github.com/charmbracelet/bubbletea v1.2.0 h1:WYHclJaFDOz4dPxiGx7owwb8P4000lYPcuXPIALS5Z8=
88
github.com/charmbracelet/bubbletea v1.2.0/go.mod h1:viLoDL7hG4njLJSKU2gw7kB3LSEmWsrM80rO1dBJWBI=
9+
github.com/charmbracelet/bubbletea v1.2.4 h1:KN8aCViA0eps9SCOThb2/XPIlea3ANJLUkv3KnQRNCE=
10+
github.com/charmbracelet/bubbletea v1.2.4/go.mod h1:Qr6fVQw+wX7JkWWkVyXYk/ZUQ92a6XNekLXa3rR18MM=
911
github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg=
1012
github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo=
1113
github.com/charmbracelet/x/ansi v0.4.5 h1:LqK4vwBNaXw2AyGIICa5/29Sbdq58GbGdFngSexTdRM=
1214
github.com/charmbracelet/x/ansi v0.4.5/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
15+
github.com/charmbracelet/x/ansi v0.6.0 h1:qOznutrb93gx9oMiGf7caF7bqqubh6YIM0SWKyA08pA=
16+
github.com/charmbracelet/x/ansi v0.6.0/go.mod h1:KBUFw1la39nl0dLl10l5ORDAqGXaeurTQmwyyVKse/Q=
1317
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q=
1418
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
1519
github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0=
1620
github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0=
21+
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
22+
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
1723
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1824
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1925
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
@@ -41,17 +47,22 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
4147
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
4248
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
4349
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
44-
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 h1:hVwzHzIUGRjiF7EcUjqNxk3NCfkPxbDKRdnNE1Rpg0U=
50+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
51+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
4552
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
46-
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
47-
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
53+
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=
54+
golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY=
55+
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
56+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
4857
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
4958
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5059
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
5160
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
61+
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
62+
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
5263
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
53-
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
54-
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
64+
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
65+
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
5566
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
5667
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
5768
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

0 commit comments

Comments
 (0)