Skip to content

Commit c93c817

Browse files
Merge pull request #111 from digitalghost-dev/1.0.1
1.0.1
2 parents dbb4304 + c664d30 commit c93c817

File tree

8 files changed

+106
-86
lines changed

8 files changed

+106
-86
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: 'v1.0.0'
29+
VERSION_NUMBER: 'v1.0.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=v1.0.0
17+
- -s -w -X main.version=v1.0.1
1818

1919
archives:
2020
- format: tar.gz

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# build 1
2-
FROM golang:1.23-alpine3.19 AS build
2+
FROM golang:1.23.6-alpine3.21 AS build
33

44
WORKDIR /app
55

@@ -8,7 +8,7 @@ RUN go mod download
88

99
COPY . .
1010

11-
RUN go build -ldflags "-X main.version=v1.0.0" -o poke-cli .
11+
RUN go build -ldflags "-X main.version=v1.0.1" -o poke-cli .
1212

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

README.md

Lines changed: 25 additions & 21 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/v1.0.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/v1.0.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">
@@ -72,7 +72,7 @@ _Use a Docker Image_
7272
* Necessary.
7373

7474
```bash
75-
docker run --rm -i -t digitalghostdev/poke-cli:v0.12.2 <command> [subcommand] flag]
75+
docker run --rm -i -t digitalghostdev/poke-cli:v1.0.1 <command> [subcommand] flag]
7676
```
7777

7878
### Go Install
@@ -87,25 +87,29 @@ _If you have Go already, install the executable yourself_
8787
## Usage
8888
By running `poke-cli [-h | --help]`, it'll display information on how to use the tool.
8989
```
90-
╭─────────────────────────────────────────────────────────╮
91-
│Welcome! This tool displays data related to Pokémon! │
92-
│ │
93-
│ USAGE: │
94-
│ poke-cli [flag] │
95-
│ poke-cli <command> [flag] │
96-
│ poke-cli <command> <subcommand> [flag] │
97-
│ │
98-
│ FLAGS: │
99-
│ -h, --help Shows the help menu │
100-
│ -l, --latest Prints the latest version available │
101-
│ -v, --version Prints the current version │
102-
│ │
103-
│ COMMANDS: │
104-
│ ability Get details about an ability │
105-
│ natures Get details about Pokémon natures │
106-
│ pokemon Get details about a specific Pokémon │
107-
│ types Get details about a specific typing │
108-
╰─────────────────────────────────────────────────────────╯
90+
╭──────────────────────────────────────────────────────────╮
91+
│Welcome! This tool displays data related to Pokémon! │
92+
│ │
93+
│ USAGE: │
94+
│ poke-cli [flag] │
95+
│ poke-cli <command> [flag] │
96+
│ poke-cli <command> <subcommand> [flag] │
97+
│ │
98+
│ FLAGS: │
99+
│ -h, --help Shows the help menu │
100+
│ -l, --latest Prints the latest version available │
101+
│ -v, --version Prints the current version │
102+
│ │
103+
│ COMMANDS: │
104+
│ ability Get details about an ability │
105+
│ natures Get details about all natures │
106+
│ pokemon Get details about a Pokémon │
107+
│ types Get details about a typing │
108+
│ │
109+
│ hint: when calling a resource with a space, use a hyphen │
110+
│ example: poke-cli ability strong-jaw │
111+
│ example: poke-cli pokemon flutter-mane │
112+
╰──────────────────────────────────────────────────────────╯
109113
```
110114

111115
---

cli.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ func runCLI(args []string) int {
6060
fmt.Sprintf("\n\t%-15s %s", "natures", "Get details about all natures"),
6161
fmt.Sprintf("\n\t%-15s %s", "pokemon", "Get details about a Pokémon"),
6262
fmt.Sprintf("\n\t%-15s %s", "types", "Get details about a typing"),
63+
"\n\n", styling.StyleItalic.Render("hint: when calling a resource with a space, use a hyphen"),
64+
"\n", styling.StyleItalic.Render("example: poke-cli ability strong-jaw"),
65+
"\n", styling.StyleItalic.Render("example: poke-cli pokemon flutter-mane"),
6366
)
6467
fmt.Println(helpMessage)
6568
}

cli_test.go

Lines changed: 71 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -95,73 +95,86 @@ func TestRunCLI(t *testing.T) {
9595
{
9696
name: "No Arguments",
9797
args: []string{},
98-
expectedOutput: "╭────────────────────────────────────────────────────────╮\n" +
99-
"│Welcome! This tool displays data related to Pokémon! │\n" +
100-
"│ │\n" +
101-
"│ USAGE: │\n" +
102-
"│ poke-cli [flag] │\n" +
103-
"│ poke-cli <command> [flag] │\n" +
104-
"│ poke-cli <command> <subcommand> [flag] │\n" +
105-
"│ │\n" +
106-
"│ FLAGS: │\n" +
107-
"│ -h, --help Shows the help menu │\n" +
108-
"│ -l, --latest Prints the latest version available │\n" +
109-
"│ -v, --version Prints the current version │\n" +
110-
"│ │\n" +
111-
"│ COMMANDS: │\n" +
112-
"│ ability Get details about an ability │\n" +
113-
"│ natures Get details about all natures │\n" +
114-
"│ pokemon Get details about a Pokémon │\n" +
115-
"│ types Get details about a typing │\n" +
116-
"╰────────────────────────────────────────────────────────╯\n",
98+
expectedOutput: "╭──────────────────────────────────────────────────────────╮\n" +
99+
"│Welcome! This tool displays data related to Pokémon! │\n" +
100+
"│ │\n" +
101+
"│ USAGE: │\n" +
102+
"│ poke-cli [flag] │\n" +
103+
"│ poke-cli <command> [flag] │\n" +
104+
"│ poke-cli <command> <subcommand> [flag] │\n" +
105+
"│ │\n" +
106+
"│ FLAGS: │\n" +
107+
"│ -h, --help Shows the help menu │\n" +
108+
"│ -l, --latest Prints the latest version available │\n" +
109+
"│ -v, --version Prints the current version │\n" +
110+
"│ │\n" +
111+
"│ COMMANDS: │\n" +
112+
"│ ability Get details about an ability │\n" +
113+
"│ natures Get details about all natures │\n" +
114+
"│ pokemon Get details about a Pokémon │\n" +
115+
"│ types Get details about a typing │\n" +
116+
"│ │\n" +
117+
"│ hint: when calling a resource with a space, use a hyphen │\n" +
118+
"│ example: poke-cli ability strong-jaw │\n" +
119+
"│ example: poke-cli pokemon flutter-mane │\n" +
120+
"╰──────────────────────────────────────────────────────────╯",
117121
expectedCode: 0,
118122
},
119123
{
120124
name: "Help Flag Short",
121125
args: []string{"-h"},
122-
expectedOutput: "╭────────────────────────────────────────────────────────╮\n" +
123-
"│Welcome! This tool displays data related to Pokémon! │\n" +
124-
"│ │\n" +
125-
"│ USAGE: │\n" +
126-
"│ poke-cli [flag] │\n" +
127-
"│ poke-cli <command> [flag] │\n" +
128-
"│ poke-cli <command> <subcommand> [flag] │\n" +
129-
"│ │\n" +
130-
"│ FLAGS: │\n" +
131-
"│ -h, --help Shows the help menu │\n" +
132-
"│ -l, --latest Prints the latest version available │\n" +
133-
"│ -v, --version Prints the current version │\n" +
134-
"│ │\n" +
135-
"│ COMMANDS: │\n" +
136-
"│ ability Get details about an ability │\n" +
137-
"│ natures Get details about all natures │\n" +
138-
"│ pokemon Get details about a Pokémon │\n" +
139-
"│ types Get details about a typing │\n" +
140-
"╰────────────────────────────────────────────────────────╯\n",
126+
expectedOutput: "╭──────────────────────────────────────────────────────────╮\n" +
127+
"│Welcome! This tool displays data related to Pokémon! │\n" +
128+
"│ │\n" +
129+
"│ USAGE: │\n" +
130+
"│ poke-cli [flag] │\n" +
131+
"│ poke-cli <command> [flag] │\n" +
132+
"│ poke-cli <command> <subcommand> [flag] │\n" +
133+
"│ │\n" +
134+
"│ FLAGS: │\n" +
135+
"│ -h, --help Shows the help menu │\n" +
136+
"│ -l, --latest Prints the latest version available │\n" +
137+
"│ -v, --version Prints the current version │\n" +
138+
"│ │\n" +
139+
"│ COMMANDS: │\n" +
140+
"│ ability Get details about an ability │\n" +
141+
"│ natures Get details about all natures │\n" +
142+
"│ pokemon Get details about a Pokémon │\n" +
143+
"│ types Get details about a typing │\n" +
144+
"│ │\n" +
145+
"│ hint: when calling a resource with a space, use a hyphen │\n" +
146+
"│ example: poke-cli ability strong-jaw │\n" +
147+
"│ example: poke-cli pokemon flutter-mane │\n" +
148+
"╰──────────────────────────────────────────────────────────╯",
141149
expectedCode: 0,
142150
},
143151
{
144152
name: "Help Flag Long",
145153
args: []string{"--help"},
146-
expectedOutput: "╭────────────────────────────────────────────────────────╮\n" +
147-
"│Welcome! This tool displays data related to Pokémon! │\n" +
148-
"│ │\n" +
149-
"│ USAGE: │\n" +
150-
"│ poke-cli [flag] │\n" +
151-
"│ poke-cli <command> [flag] │\n" +
152-
"│ poke-cli <command> <subcommand> [flag] │\n" +
153-
"│ │\n" +
154-
"│ FLAGS: │\n" +
155-
"│ -h, --help Shows the help menu │\n" +
156-
"│ -l, --latest Prints the latest version available │\n" +
157-
"│ -v, --version Prints the current version │\n" +
158-
"│ │\n" +
159-
"│ COMMANDS: │\n" +
160-
"│ ability Get details about an ability │\n" +
161-
"│ natures Get details about all natures │\n" +
162-
"│ pokemon Get details about a Pokémon │\n" +
163-
"│ types Get details about a typing │\n" +
164-
"╰────────────────────────────────────────────────────────╯\n",
154+
expectedOutput: "╭──────────────────────────────────────────────────────────╮\n" +
155+
"│Welcome! This tool displays data related to Pokémon! │\n" +
156+
"│ │\n" +
157+
"│ USAGE: │\n" +
158+
"│ poke-cli [flag] │\n" +
159+
"│ poke-cli <command> [flag] │\n" +
160+
"│ poke-cli <command> <subcommand> [flag] │\n" +
161+
"│ │\n" +
162+
"│ FLAGS: │\n" +
163+
"│ -h, --help Shows the help menu │\n" +
164+
"│ -l, --latest Prints the latest version available │\n" +
165+
"│ -v, --version Prints the current version │\n" +
166+
"│ │\n" +
167+
"│ COMMANDS: │\n" +
168+
"│ ability Get details about an ability │\n" +
169+
"│ natures Get details about all natures │\n" +
170+
"│ pokemon Get details about a Pokémon │\n" +
171+
"│ types Get details about a typing │\n" +
172+
"│ │\n" +
173+
"│ hint: when calling a resource with a space, use a hyphen │\n" +
174+
"│ example: poke-cli ability strong-jaw │\n" +
175+
"│ example: poke-cli pokemon flutter-mane │\n" +
176+
"╰──────────────────────────────────────────────────────────╯",
177+
165178
expectedCode: 0,
166179
},
167180
{
@@ -173,7 +186,7 @@ func TestRunCLI(t *testing.T) {
173186
{
174187
name: "Latest Flag",
175188
args: []string{"-l"},
176-
expectedOutput: "Latest Docker image version: v0.12.2\nLatest release tag: v0.12.2\n",
189+
expectedOutput: "Latest Docker image version: v1.0.0\nLatest release tag: v1.0.0\n",
177190
expectedCode: 0,
178191
},
179192
}

connections/connection.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func AbilityApiCall(endpoint string, abilityName string, baseURL string) (struct
6262
if err != nil {
6363
errMessage := errorBorder.Render(
6464
errorColor.Render("Error!"),
65-
"\nAbility not found.\nPerhaps a typo?",
65+
"\nAbility not found.\n\u2022 Perhaps a typo?\n\u2022 Missing a hyphen instead of a space?",
6666
)
6767
return structs.AbilityJSONStruct{}, "", fmt.Errorf("%s", errMessage)
6868
}
@@ -79,7 +79,7 @@ func PokemonApiCall(endpoint string, pokemonName string, baseURL string) (struct
7979
if err != nil {
8080
errMessage := errorBorder.Render(
8181
errorColor.Render("Error!"),
82-
"\nPokémon not found.\nPerhaps a typo?",
82+
"\nPokémon not found.\n\u2022 Perhaps a typo?\n\u2022 Missing a hyphen instead of a space?",
8383
)
8484
return structs.PokemonJSONStruct{}, "", 0, 0, 0, fmt.Errorf("%s", errMessage)
8585
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/digitalghost-dev/poke-cli
22

3-
go 1.23.2
3+
go 1.23.6
44

55
require (
66
github.com/charmbracelet/bubbles v0.20.0

0 commit comments

Comments
 (0)