Skip to content

Commit ed6e50d

Browse files
Merge pull request #105 from digitalghost-dev/0.12.1
0.12.1
2 parents 8da2916 + b9209bd commit ed6e50d

File tree

7 files changed

+74
-72
lines changed

7 files changed

+74
-72
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.12.0'
29+
VERSION_NUMBER: 'v0.12.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.12.0
17+
- -s -w -X main.version=v0.12.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.12.0" -o poke-cli .
11+
RUN go build -ldflags "-X main.version=v0.12.1" -o poke-cli .
1212

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

README.md

Lines changed: 2 additions & 2 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.12.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.12.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">
@@ -68,7 +68,7 @@ _Use a Docker Image_
6868
* Necessary.
6969

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

7474
### Go Install

cli_test.go

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -95,73 +95,73 @@ 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 Pokémon natures │\n" +
114-
"│ pokemon Get details about a specific Pokémon │\n" +
115-
"│ types Get details about a specific 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",
117117
expectedCode: 0,
118118
},
119119
{
120120
name: "Help Flag Short",
121121
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 Pokémon natures │\n" +
138-
"│ pokemon Get details about a specific Pokémon │\n" +
139-
"│ types Get details about a specific typing │\n" +
140-
"╰────────────────────────────────────────────────────────\n",
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",
141141
expectedCode: 0,
142142
},
143143
{
144144
name: "Help Flag Long",
145145
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 Pokémon natures │\n" +
162-
"│ pokemon Get details about a specific Pokémon │\n" +
163-
"│ types Get details about a specific typing │\n" +
164-
"╰────────────────────────────────────────────────────────\n",
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",
165165
expectedCode: 0,
166166
},
167167
{
@@ -173,7 +173,7 @@ func TestRunCLI(t *testing.T) {
173173
{
174174
name: "Latest Flag",
175175
args: []string{"-l"},
176-
expectedOutput: "Latest Docker image version: v0.11.1\nLatest release tag: v0.11.1\n",
176+
expectedOutput: "Latest Docker image version: v0.12.0\nLatest release tag: v0.12.0\n",
177177
expectedCode: 0,
178178
},
179179
}

cmd/natures_test.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,12 @@ func TestNaturesCommand(t *testing.T) {
4848
{
4949
name: "Help flag",
5050
args: []string{"natures", "-h"},
51-
expectedOutput: "╭────────────────────────────────────────────────────────────╮\n" +
52-
"│Get details about Pokémon natures. │\n" +
53-
"│ │\n" +
54-
"│ USAGE: │\n" +
55-
"│ poke-cli natures [flag] │\n" +
56-
"│ │\n" +
57-
"│ FLAGS: │\n" +
58-
"│ -h, --help Prints out the help menu.│\n" +
59-
"╰────────────────────────────────────────────────────────────╯\n",
51+
expectedOutput: "╭──────────────────────────────╮\n" +
52+
"│Get details about all natures.│\n" +
53+
"│ │\n" +
54+
"│ USAGE: │\n" +
55+
"│ poke-cli natures │\n" +
56+
"╰──────────────────────────────╯\n",
6057
expectError: false,
6158
},
6259
{

cmd/validateargs.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ func ValidateAbilityArgs(args []string) error {
2525
return fmt.Errorf("%s", errMessage)
2626
}
2727

28+
if len(args) == 2 {
29+
errMessage := errorBorder.Render(errorColor.Render("Error!"), "\nPlease specify an ability")
30+
return fmt.Errorf("%s", errMessage)
31+
}
32+
2833
return nil
2934
}
3035

0 commit comments

Comments
 (0)