Skip to content

Commit 4d6237c

Browse files
Merge pull request #268 from digitalghost-dev/1.9.3
1.9.3
2 parents 224bfd3 + 5bdc1db commit 4d6237c

67 files changed

Lines changed: 618 additions & 515 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
- main
3232

3333
env:
34-
VERSION_NUMBER: 'v1.9.2'
34+
VERSION_NUMBER: 'v1.9.3'
3535
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
3636
AWS_REGION: 'us-west-2'
3737

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ web/.coverage
3737
# Python
3838
card_data/.venv
3939
__pycache__/
40+
.ruff_cache/
4041

4142
# Terraform
4243
.terraformrc

.goreleaser.yml

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=v1.9.2
17+
- -s -w -X main.version=v1.9.3
1818

1919
archives:
2020
- formats: [ 'zip' ]

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=v1.9.2" -o poke-cli .
11+
RUN go build -ldflags "-X main.version=v1.9.3" -o poke-cli .
1212

1313
# build 2
1414
FROM --platform=$BUILDPLATFORM alpine:3.23

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img width="425" src="poke-cli.png" alt="pokemon-logo"/>
33
<h4></h4>
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/v1.9.2?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/v1.9.3?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">
@@ -99,11 +99,11 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
9999
3. Choose how to interact with the container:
100100
* Run a single command and exit:
101101
```bash
102-
docker run --rm -it digitalghostdev/poke-cli:v1.9.2 <command> [subcommand] [flag]
102+
docker run --rm -it digitalghostdev/poke-cli:v1.9.3 <command> [subcommand] [flag]
103103
```
104104
* Enter the container and use its shell:
105105
```bash
106-
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.9.2 -c "cd /app && exec sh"
106+
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.9.3 -c "cd /app && exec sh"
107107
# placed into the /app directory, run the program with './poke-cli'
108108
# example: ./poke-cli ability swift-swim
109109
```
@@ -112,13 +112,13 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
112112
> The `card` command renders TCG card images using your terminal's graphics protocol. When running inside Docker, pass your terminal's environment variables so image rendering works correctly:
113113
> ```bash
114114
> # Kitty
115-
> docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.2 card
115+
> docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.3 card
116116
>
117117
> # WezTerm, iTerm2, Ghostty, Konsole, Rio, Tabby
118-
> docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.2 card
118+
> docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.3 card
119119
>
120120
> # Windows Terminal (Sixel)
121-
> docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.2 card
121+
> docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.3 card
122122
> ```
123123
> If your terminal is not listed above, image rendering is not supported inside Docker.
124124

card_data/pipelines/poke_cli_dbt/dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'poke_cli_dbt'
2-
version: '1.9.2'
2+
version: '1.9.3'
33

44
profile: 'poke_cli_dbt'
55

cli.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,11 @@ func runCLI(args []string) int {
159159
case exists:
160160
return cmdFunc()
161161
default:
162-
errMessage := styling.ErrorBorder.Render(
163-
styling.ErrorColor.Render("✖ Error!"),
164-
fmt.Sprintf("\n\t%-15s", fmt.Sprintf("'%s' is not a valid command.\n", cmdArg)),
165-
styling.StyleBold.Render("\nCommands:"),
166-
renderCommandList(),
167-
fmt.Sprintf("\n\nAlso run %s for more info!", styling.StyleBold.Render("poke-cli -h")),
168-
)
169-
output.WriteString(errMessage)
162+
msg := fmt.Sprintf("\t%-15s", fmt.Sprintf("'%s' is not a valid command.\n", cmdArg)) +
163+
styling.StyleBold.Render("\nCommands:") +
164+
renderCommandList() +
165+
fmt.Sprintf("\n\nAlso run %s for more info!", styling.StyleBold.Render("poke-cli -h"))
166+
output.WriteString(utils.FormatError(msg))
170167

171168
fmt.Println(output.String())
172169

cli_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ func TestRunCLI_VariousCommands(t *testing.T) {
132132
args []string
133133
expected int
134134
}{
135-
//{"Invalid command", []string{"foobar"}, 1},
135+
{"Invalid command", []string{"foobar"}, 1},
136136
{"Latest flag long", []string{"--latest"}, 0},
137137
{"Latest flag short", []string{"-l"}, 0},
138138
{"Version flag long", []string{"--version"}, 0},
139139
{"Version flag short", []string{"-v"}, 0},
140140
{"Search command with invalid args", []string{"search", "pokemon", "extra-arg"}, 1},
141-
//{"Missing Pokémon name", []string{"pokemon"}, 1},
142-
//{"Another invalid command", []string{"invalid"}, 1},
141+
{"Missing Pokémon name", []string{"pokemon"}, 1},
142+
{"Another invalid command", []string{"invalid"}, 1},
143143
}
144144

145145
for _, tt := range tests {

cmd/ability/ability.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ability
22

33
import (
4+
"errors"
45
"flag"
56
"fmt"
67
"os"
@@ -48,9 +49,10 @@ func AbilityCommand() (string, error) {
4849
abilityName := strings.ToLower(args[2])
4950

5051
if err := af.FlagSet.Parse(args[3:]); err != nil {
52+
if errors.Is(err, flag.ErrHelp) {
53+
return output.String(), nil
54+
}
5155
fmt.Fprintf(&output, "error parsing flags: %v\n", err)
52-
af.FlagSet.Usage()
53-
5456
return output.String(), err
5557
}
5658

cmd/ability/ability_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ func TestAbilityCommand(t *testing.T) {
5252
args: []string{"ability", "poison-point"},
5353
expectedOutput: utils.LoadGolden(t, "ability_poison_point.golden"),
5454
},
55+
{
56+
name: "Ability invalid flag",
57+
args: []string{"ability", "clear-body", "--bogus"},
58+
expectedOutput: utils.LoadGolden(t, "ability_invalid_flag.golden"),
59+
wantError: true,
60+
},
5561
}
5662

5763
for _, tt := range tests {

0 commit comments

Comments
 (0)