diff --git a/.dockerignore b/.dockerignore
index c480acf..429eae8 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -25,4 +25,7 @@ go.work.sum
dist/
# testdata
-testdata/
\ No newline at end of file
+testdata/
+
+# Python data
+card_data/
\ No newline at end of file
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6d264e7..b22d9a5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -28,7 +28,7 @@ on:
- main
env:
- VERSION_NUMBER: 'v1.5.0'
+ VERSION_NUMBER: 'v1.5.1'
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
AWS_REGION: 'us-west-2'
diff --git a/.gitignore b/.gitignore
index 43b0a1d..5c174e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,8 +32,8 @@ card_data/.venv
__pycache__/
# Terraform
-card_data/terraform/access-token
-/card_data/terraform/access-token
-card_data/terraform/secrets.tfvars
-card_data/terraform/terraform.tfstate
-/card_data/terraform/.terraform/
+card_data/infra/access-token
+/card_data/infra/access-token
+card_data/infra/secrets.tfvars
+card_data/infra/terraform.tfstate
+/card_data/infra/.terraform/
diff --git a/.goreleaser.yml b/.goreleaser.yml
index de0dbd5..378ebea 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -14,7 +14,7 @@ builds:
- windows
- darwin
ldflags:
- - -s -w -X main.version=v1.5.0
+ - -s -w -X main.version=v1.5.1
archives:
- formats: [ 'zip' ]
diff --git a/Dockerfile b/Dockerfile
index b93908e..a34273d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@ RUN go mod download
COPY . .
-RUN go build -ldflags "-X main.version=v1.5.0" -o poke-cli .
+RUN go build -ldflags "-X main.version=v1.5.1" -o poke-cli .
# build 2
FROM --platform=$BUILDPLATFORM alpine:3.22
diff --git a/README.md b/README.md
index 4322495..5a196e3 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
Pokémon CLI
-
+
@@ -24,7 +24,7 @@ View future plans in the [Roadmap](#roadmap) section.
---
## Demo
-
+
---
## Installation
@@ -78,11 +78,11 @@ View future plans in the [Roadmap](#roadmap) section.
3. Choose how to interact with the container:
* Run a single command and exit:
```bash
- docker run --rm -it digitalghostdev/poke-cli:v1.5.0
[subcommand] flag]
+ docker run --rm -it digitalghostdev/poke-cli:v1.5.1 [subcommand] flag]
```
* Enter the container and use its shell:
```bash
- docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.5.0 -c "cd /app && exec sh"
+ docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.5.1 -c "cd /app && exec sh"
# placed into the /app directory, run the program with './poke-cli'
# example: ./poke-cli ability swift-swim
```
@@ -118,7 +118,7 @@ View future plans in the [Roadmap](#roadmap) section.
---
## Usage
-By running `poke-cli [-h | --help]`, it'll display information on how to use the tool.
+By running `poke-cli [-h | --help]`, it'll display information on how to use the tool or check out the [docs](https://docs.poke-cli.com/)!
```
╭───────────────────────────────────────────────────────────────╮
│Welcome! This tool displays data related to Pokémon! │
@@ -166,9 +166,9 @@ Below is a list of the planned/completed commands and flags:
- [x] `natures`: get data about natures.
- [x] `pokemon`: get data about a Pokémon.
- [x] `-a | --abilities`: display the Pokémon's abilities.
+ - [ ] `-d | --defense`: display the Pokémon's type defences.
- [x] `-i | --image`: display a pixel image of the Pokémon.
- [x] `-s | --stats`: display the Pokémon's base stats.
- - [x] `-t | --types`: display the Pokémon's typing.
- [x] `-m | --moves`: display learnable moves.
- [ ] `search`: search for a resource
- [x] `ability`
@@ -181,13 +181,14 @@ Below is a list of the planned/completed commands and flags:
---
## Tested Terminals
-| OS | Terminal | Status | Issues |
-|---------|-------------------|:------:|-------------------------------|
-| macOS | Ghostty | ✅ | None |
-| macOS | Alacritty | ✅ | None |
-| macOS | HyperJS | ✅ | None |
-| macOS | iTerm2 | ✅ | None |
-| macOS | macOS Terminal | ⚠️ | Images do not render properly |
-| Windows | Windows Terminal | ✅ | None |
-| Ubuntu | Standard Terminal | ✅ | None |
-| Ubuntu | Tabby | ✅ | None |
\ No newline at end of file
+| Terminal | OS | Status | Issues |
+|------------------|:-------------------------:|:------:|-----------------------------------------|
+| Alacritty | macOS, Ubuntu,
Windows | ✅ | None |
+| Ghostty | macOS | ✅ | None |
+| HyperJS | macOS | ✅ | None |
+| iTerm2 | macOS | ✅ | None |
+| Linux Terminal | Ubuntu | ✅ | None |
+| macOS Terminal | macOS | ⚠️ | `pokemon [name] --image=xx` flag issues |
+| Tabby | Ubuntu | ✅ | None |
+| WezTerm | macOS, Windows | ✅ | None |
+| Windows Terminal | Windows | ✅ | None |
\ No newline at end of file
diff --git a/cli.go b/cli.go
index 8c1d3cd..fe14444 100644
--- a/cli.go
+++ b/cli.go
@@ -135,7 +135,7 @@ func runCLI(args []string) int {
return cmdFunc()
default:
errMessage := styling.ErrorBorder.Render(
- styling.ErrorColor.Render("Error!"),
+ styling.ErrorColor.Render("✖ Error!"),
fmt.Sprintf("\n\t%-15s", fmt.Sprintf("'%s' is not a valid command.\n", cmdArg)),
styling.StyleBold.Render("\nCommands:"),
fmt.Sprintf("\n\t%-15s %s", "ability", "Get details about an ability"),
diff --git a/cmd/pokemon/pokemon.go b/cmd/pokemon/pokemon.go
index b9eade9..a13414b 100644
--- a/cmd/pokemon/pokemon.go
+++ b/cmd/pokemon/pokemon.go
@@ -1,14 +1,17 @@
package pokemon
import (
+ "bytes"
"flag"
"fmt"
+ "github.com/charmbracelet/lipgloss"
"github.com/digitalghost-dev/poke-cli/cmd/utils"
"github.com/digitalghost-dev/poke-cli/connections"
"github.com/digitalghost-dev/poke-cli/flags"
"github.com/digitalghost-dev/poke-cli/styling"
"golang.org/x/text/cases"
"golang.org/x/text/language"
+ "io"
"math"
"os"
"strings"
@@ -21,6 +24,7 @@ func PokemonCommand() (string, error) {
hintMessage := styling.StyleItalic.Render("options: [sm, md, lg]")
flag.Usage = func() {
+ styledFlag := styling.ErrorColor.Render(fmt.Sprintf("%-30s", "-t, --types"))
helpMessage := styling.HelpBorder.Render(
"Get details about a specific Pokémon.\n\n",
styling.StyleBold.Render("USAGE:"),
@@ -33,7 +37,7 @@ func PokemonCommand() (string, error) {
fmt.Sprintf("\n\t%5s%-15s", "", hintMessage),
fmt.Sprintf("\n\t%-30s %s", "-m, --moves", "Prints the Pokemon's learnable moves."),
fmt.Sprintf("\n\t%-30s %s", "-s, --stats", "Prints the Pokémon's base stats."),
- fmt.Sprintf("\n\t%-30s %s", "-t, --types", "Prints the Pokémon's typing."),
+ fmt.Sprintf("\n\t%s %s", styledFlag, styling.ErrorColor.Render("Deprecated. Types are included with each Pokémon.")),
fmt.Sprintf("\n\t%-30s %s", "-h, --help", "Prints the help menu."),
)
output.WriteString(helpMessage)
@@ -88,11 +92,39 @@ func PokemonCommand() (string, error) {
inches = 0
}
+ typing := func(w io.Writer) {
+ var typeBoxes []string
+
+ for _, pokeType := range pokemonStruct.Types {
+ colorHex, exists := styling.ColorMap[pokeType.Type.Name]
+ if exists {
+ color := lipgloss.Color(colorHex)
+ typeColorStyle := lipgloss.NewStyle().
+ Align(lipgloss.Center).
+ Foreground(lipgloss.Color("#FAFAFA")).
+ Background(color).
+ Margin(1, 1, 0, 0).
+ Height(1).
+ Width(14)
+
+ rendered := typeColorStyle.Render(cases.Title(language.English).String(pokeType.Type.Name))
+ typeBoxes = append(typeBoxes, rendered)
+ }
+ }
+
+ joinedTypes := lipgloss.JoinHorizontal(lipgloss.Top, typeBoxes...)
+ fmt.Fprintln(w, joinedTypes)
+ }
+
+ var typeOutput bytes.Buffer
+ typing(&typeOutput)
+
output.WriteString(fmt.Sprintf(
- "Your selected Pokémon: %s\n%s National Pokédex #: %d\n%s Weight: %.1fkg (%.1f lbs)\n%s Height: %.1fm (%d′%02d″)\n",
- capitalizedString, styling.ColoredBullet, pokemonStruct.ID,
+ "Your selected Pokémon: %s\n%s\n%s National Pokédex #: %d\n%s Weight: %.1fkg (%.1f lbs)\n%s Height: %.1fm (%d′%02d″)\n",
+ capitalizedString, typeOutput.String(),
+ styling.ColoredBullet, pokemonStruct.ID,
styling.ColoredBullet, weightKilograms, weightPounds,
- styling.ColoredBullet, heightFeet, feet, inches,
+ styling.ColoredBullet, heightMeters, feet, inches,
))
if *imageFlag != "" || *shortImageFlag != "" {
diff --git a/cmd/pokemon/pokemon_test.go b/cmd/pokemon/pokemon_test.go
index 5a3ceae..157a17f 100644
--- a/cmd/pokemon/pokemon_test.go
+++ b/cmd/pokemon/pokemon_test.go
@@ -32,6 +32,12 @@ func TestPokemonCommand(t *testing.T) {
args: []string{"pokemon", "--help"},
expectedOutput: utils.LoadGolden(t, "pokemon_help.golden"),
},
+ {
+ name: "Pokemon no flags with dual type",
+ args: []string{"pokemon", "victini"},
+ expectedOutput: utils.LoadGolden(t, "pokemon_no_flags_dual_type.golden"),
+ expectedError: true,
+ },
{
name: "Pokemon abilities flag",
args: []string{"pokemon", "metagross", "--abilities"},
@@ -65,11 +71,6 @@ func TestPokemonCommand(t *testing.T) {
args: []string{"pokemon", "toxicroak", "--stats"},
expectedOutput: utils.LoadGolden(t, "pokemon_stats.golden"),
},
- {
- name: "Pokemon typed flags",
- args: []string{"pokemon", "armarouge", "--types"},
- expectedOutput: utils.LoadGolden(t, "pokemon_types.golden"),
- },
}
for _, tt := range tests {
diff --git a/cmd/search/model_input.go b/cmd/search/model_input.go
index d2eb458..82457e3 100644
--- a/cmd/search/model_input.go
+++ b/cmd/search/model_input.go
@@ -31,7 +31,7 @@ func UpdateInput(msg tea.Msg, m Model) (tea.Model, tea.Cmd) {
// checking for blank queries
if strings.TrimSpace(searchTerm) == "" {
- errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("Error!"), "\nNo blank queries")
+ errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("✖ Error!"), "\nNo blank queries")
m.WarningMessage = errMessage
return m, nil
}
diff --git a/cmd/utils/validateargs.go b/cmd/utils/validateargs.go
index 791d763..41b42be 100644
--- a/cmd/utils/validateargs.go
+++ b/cmd/utils/validateargs.go
@@ -10,7 +10,7 @@ import (
func checkLength(args []string, max int) error {
if len(args) > max {
errMessage := styling.ErrorBorder.Render(
- styling.ErrorColor.Render("Error!") + "\nToo many arguments",
+ styling.ErrorColor.Render("✖ Error!") + "\nToo many arguments",
)
return fmt.Errorf("%s", errMessage)
}
@@ -20,7 +20,7 @@ func checkLength(args []string, max int) error {
// checkNoOtherOptions checks if there are exactly 3 arguments and the third argument is neither '-h' nor '--help'
func checkNoOtherOptions(args []string, max int, commandName string) error {
if len(args) == max && args[2] != "-h" && args[2] != "--help" {
- errMsg := styling.ErrorColor.Render("Error!") +
+ errMsg := styling.ErrorColor.Render("✖ Error!") +
"\nThe only available options after the\n" + commandName + " command are '-h' or '--help'"
return fmt.Errorf("%s", styling.ErrorBorder.Render(errMsg))
}
@@ -34,7 +34,7 @@ func ValidateAbilityArgs(args []string) error {
}
if len(args) == 2 {
- errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("Error!"), "\nPlease specify an ability")
+ errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("✖ Error!"), "\nPlease specify an ability")
return fmt.Errorf("%s", errMessage)
}
@@ -48,7 +48,7 @@ func ValidateItemArgs(args []string) error {
}
if len(args) == 2 {
- errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("Error!"), "\nPlease specify an item ")
+ errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("✖ Error!"), "\nPlease specify an item ")
return fmt.Errorf("%s", errMessage)
}
@@ -62,7 +62,7 @@ func ValidateMoveArgs(args []string) error {
}
if len(args) == 2 {
- errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("Error!"), "\nPlease specify a move ")
+ errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("✖ Error!"), "\nPlease specify a move ")
return fmt.Errorf("%s", errMessage)
}
@@ -87,7 +87,7 @@ func ValidatePokemonArgs(args []string) error {
// Check if the number of arguments is less than 3
if len(args) < 3 {
errMessage := styling.ErrorBorder.Render(
- styling.ErrorColor.Render("Error!"),
+ styling.ErrorColor.Render("✖ Error!"),
"\nPlease declare a Pokémon's name after the command",
"\nRun 'poke-cli pokemon -h' for more details",
"\nerror: insufficient arguments",
@@ -101,7 +101,7 @@ func ValidatePokemonArgs(args []string) error {
printImageFlagError := func() error {
msg := styling.ErrorBorder.Render(
- styling.ErrorColor.Render("Error!") +
+ styling.ErrorColor.Render("✖ Error!") +
"\nThe image flag (-i or --image) requires a non-empty value.\nValid sizes are: lg, md, sm.",
)
return fmt.Errorf("%s", msg)
@@ -123,7 +123,7 @@ func ValidatePokemonArgs(args []string) error {
for _, arg := range args[3:] {
// Check for an empty flag after Pokémon's name
if arg == "-" || arg == "--" {
- errorTitle := styling.ErrorColor.Render("Error!")
+ errorTitle := styling.ErrorColor.Render("✖ Error!")
errorString := fmt.Sprintf(
"\nEmpty flag '%s'.\nPlease specify valid flag(s).",
arg,
@@ -135,7 +135,7 @@ func ValidatePokemonArgs(args []string) error {
// Check if the argument after Pokémon's name is an attempted flag
if arg[0] != '-' {
- errorTitle := styling.ErrorColor.Render("Error!")
+ errorTitle := styling.ErrorColor.Render("✖ Error!")
errorString := fmt.Sprintf(
"\nInvalid argument '%s'.\nOnly flags are allowed after declaring a Pokémon's name",
arg,
diff --git a/cmd/utils/validateargs_test.go b/cmd/utils/validateargs_test.go
index 72fac47..8094c97 100644
--- a/cmd/utils/validateargs_test.go
+++ b/cmd/utils/validateargs_test.go
@@ -91,7 +91,7 @@ func TestValidateAbilityArgs(t *testing.T) {
{"poke-cli", "ability", "strong-jaw", "all", "pokemon"},
}
- expectedError := styling.StripANSI("╭──────────────────╮\n│Error! │\n│Too many arguments│\n╰──────────────────╯")
+ expectedError := styling.StripANSI("╭──────────────────╮\n│✖ Error! │\n│Too many arguments│\n╰──────────────────╯")
for _, input := range tooManyArgs {
err := ValidateAbilityArgs(input)
@@ -168,7 +168,7 @@ func TestValidatePokemonArgs(t *testing.T) {
{"poke-cli", "pokemon", "hypo", "--abilities", "-s", "--types", "--image=sm", "-m", "-p"},
}
- expectedError := styling.StripANSI("╭──────────────────╮\n│Error! │\n│Too many arguments│\n╰──────────────────╯")
+ expectedError := styling.StripANSI("╭──────────────────╮\n│✖ Error! │\n│Too many arguments│\n╰──────────────────╯")
for _, input := range tooManyArgs {
err := ValidatePokemonArgs(input)
@@ -207,7 +207,7 @@ func TestValidateSearchArgs(t *testing.T) {
{"poke-cli", "search", "pokemon", "meowscarada"},
}
- expectedError := styling.StripANSI("╭──────────────────╮\n│Error! │\n│Too many arguments│\n╰──────────────────╯")
+ expectedError := styling.StripANSI("╭──────────────────╮\n│✖ Error! │\n│Too many arguments│\n╰──────────────────╯")
for _, input := range tooManyArgs {
err := ValidateSearchArgs(input)
@@ -249,7 +249,7 @@ func TestValidateTypesArgs(t *testing.T) {
{"poke-cli", "types", "rock", "pokemon"},
}
- expectedError := styling.StripANSI("╭──────────────────╮\n│Error! │\n│Too many arguments│\n╰──────────────────╯")
+ expectedError := styling.StripANSI("╭──────────────────╮\n│✖ Error! │\n│Too many arguments│\n╰──────────────────╯")
for _, input := range tooManyArgs {
err := ValidateTypesArgs(input)
diff --git a/connections/connection.go b/connections/connection.go
index f4bca9e..9d0f1a4 100644
--- a/connections/connection.go
+++ b/connections/connection.go
@@ -57,7 +57,7 @@ func AbilityApiCall(endpoint string, abilityName string, baseURL string) (struct
if err != nil {
errMessage := styling.ErrorBorder.Render(
- styling.ErrorColor.Render("Error!"),
+ styling.ErrorColor.Render("✖ Error!"),
"\nAbility not found.\n\u2022 Perhaps a typo?\n\u2022 Missing a hyphen instead of a space?",
)
return structs.AbilityJSONStruct{}, "", fmt.Errorf("%s", errMessage)
@@ -75,7 +75,7 @@ func ItemApiCall(endpoint string, itemName string, baseURL string) (structs.Item
if err != nil {
errMessage := styling.ErrorBorder.Render(
- styling.ErrorColor.Render("Error!"),
+ styling.ErrorColor.Render("✖ Error!"),
"\nItem not found.\n\u2022 Perhaps a typo?\n\u2022 Missing a hyphen instead of a space?",
)
return structs.ItemJSONStruct{}, "", fmt.Errorf("%s", errMessage)
@@ -93,7 +93,7 @@ func MoveApiCall(endpoint string, moveName string, baseURL string) (structs.Move
if err != nil {
errMessage := styling.ErrorBorder.Render(
- styling.ErrorColor.Render("Error!"),
+ styling.ErrorColor.Render("✖ Error!"),
"\nMove not found.\n\u2022 Perhaps a typo?\n\u2022 Missing a hyphen instead of a space?",
)
return structs.MoveJSONStruct{}, "", fmt.Errorf("%s", errMessage)
@@ -111,7 +111,7 @@ func PokemonApiCall(endpoint string, pokemonName string, baseURL string) (struct
if err != nil {
errMessage := styling.ErrorBorder.Render(
- styling.ErrorColor.Render("Error!"),
+ styling.ErrorColor.Render("✖ Error!"),
"\nPokémon not found.\n\u2022 Perhaps a typo?\n\u2022 Missing a hyphen instead of a space?",
)
return structs.PokemonJSONStruct{}, "", fmt.Errorf("%s", errMessage)
diff --git a/demo.gif b/demo.gif
index c2b828f..b144a9e 100644
Binary files a/demo.gif and b/demo.gif differ
diff --git a/demo.tape b/demo.tape
index 094d66c..966b6b8 100644
--- a/demo.tape
+++ b/demo.tape
@@ -63,10 +63,10 @@ Set Shell "bash"
Set FontSize 32
Set Width 2300
Set Height 1300
-Set TypingSpeed 95ms
+Set TypingSpeed 100ms
Set Theme "tokyonight-storm"
-Type "poke-cli pokemon charizard --abilities --stats --types"
+Type "poke-cli pokemon charizard --abilities --stats"
Sleep 2s
diff --git a/docs/assets/pokemon_abilities_moves.gif b/docs/assets/pokemon_abilities_moves.gif
index 8d51adf..aa299d1 100644
Binary files a/docs/assets/pokemon_abilities_moves.gif and b/docs/assets/pokemon_abilities_moves.gif differ
diff --git a/docs/assets/pokemon_stats.gif b/docs/assets/pokemon_stats.gif
new file mode 100644
index 0000000..37fc520
Binary files /dev/null and b/docs/assets/pokemon_stats.gif differ
diff --git a/docs/assets/pokemon_stats_types.gif b/docs/assets/pokemon_stats_types.gif
deleted file mode 100644
index 68d9932..0000000
Binary files a/docs/assets/pokemon_stats_types.gif and /dev/null differ
diff --git a/docs/commands.md b/docs/commands.md
index 4ab9af0..9f4bd4b 100644
--- a/docs/commands.md
+++ b/docs/commands.md
@@ -86,6 +86,11 @@ Output:
* `--stats | -s`
* `--types | -t`
+!!! warning
+
+ The `-t | --types` flag is deprecated will be removed in v2.
+ The Pokémon's typing is now included in the base `pokemon` command.
+
Example:
```console
$ poke-cli pokemon rockruff --abilities --moves
@@ -107,12 +112,12 @@ Output:
Example:
```console
-$ poke-cli pokemon cacturne --stats --types
+$ poke-cli pokemon cacturne --stats
```
Output:
-
+
---
diff --git a/flags/pokemonflagset.go b/flags/pokemonflagset.go
index 8fb4dcf..aefa92e 100644
--- a/flags/pokemonflagset.go
+++ b/flags/pokemonflagset.go
@@ -194,7 +194,7 @@ func ImageFlag(w io.Writer, endpoint string, pokemonName string, size string) er
// Validate size
dimensions, exists := sizeMap[strings.ToLower(size)]
if !exists {
- errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("Error!"), "\nInvalid image size.\nValid sizes are: lg, md, sm")
+ errMessage := styling.ErrorBorder.Render(styling.ErrorColor.Render("✖ Error!"), "\nInvalid image size.\nValid sizes are: lg, md, sm")
return fmt.Errorf("%s", errMessage)
}
@@ -477,5 +477,7 @@ func TypesFlag(w io.Writer, endpoint string, pokemonName string) error {
}
}
+ fmt.Fprintln(w, styling.WarningBorder.Render(styling.WarningColor.Render("⚠ Warning!"), "\nThe '-t | --types' flag is deprecated\nand will be removed in v2.\n\nTyping is now included by default.\nYou no longer need this flag. "))
+
return nil
}
diff --git a/flags/pokemonflagset_test.go b/flags/pokemonflagset_test.go
index cbc3d85..12a4a5c 100644
--- a/flags/pokemonflagset_test.go
+++ b/flags/pokemonflagset_test.go
@@ -262,6 +262,14 @@ func TestTypesFlag(t *testing.T) {
Typing
Type 1: Grass
Type 2: Poison
+╭─────────────────────────────────────╮
+│⚠ Warning! │
+│The '-t | --types' flag is deprecated│
+│and will be removed in v2. │
+│ │
+│Typing is now included by default. │
+│You no longer need this flag. │
+╰─────────────────────────────────────╯
`
// Assert output contains the expected header and typing information
diff --git a/mkdocs.yml b/mkdocs.yml
index a73ff08..a34882a 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -1,6 +1,20 @@
site_name: poke-cli
theme:
+ icon:
+ admonition:
+ note: octicons/tag-16
+ abstract: octicons/checklist-16
+ info: octicons/info-16
+ tip: octicons/squirrel-16
+ success: octicons/check-16
+ question: octicons/question-16
+ warning: octicons/alert-16
+ failure: octicons/x-circle-16
+ danger: octicons/zap-16
+ bug: octicons/bug-16
+ example: octicons/beaker-16
+ quote: octicons/quote-16
name: material
palette:
# Palette toggle for automatic mode
@@ -31,6 +45,9 @@ theme:
repo_url: https://github.com/digitalghost-dev/poke-cli
markdown_extensions:
+ - admonition
+ - pymdownx.superfences
+ - pymdownx.details
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
@@ -41,7 +58,6 @@ markdown_extensions:
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- - pymdownx.superfences
extra:
social:
diff --git a/styling/styling.go b/styling/styling.go
index 8499d35..8c43ac3 100644
--- a/styling/styling.go
+++ b/styling/styling.go
@@ -35,6 +35,10 @@ var (
ErrorBorder = lipgloss.NewStyle().
BorderStyle(lipgloss.RoundedBorder()).
BorderForeground(lipgloss.Color("#F2055C"))
+ WarningColor = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF8C00"))
+ WarningBorder = lipgloss.NewStyle().
+ BorderStyle(lipgloss.RoundedBorder()).
+ BorderForeground(lipgloss.Color("#FF8C00"))
TypesTableBorder = lipgloss.NewStyle().
BorderStyle(lipgloss.NormalBorder()).
BorderForeground(lipgloss.Color("#FFCC00"))
diff --git a/testdata/ability_misspelled.golden b/testdata/ability_misspelled.golden
index 5dec212..54daf5c 100644
--- a/testdata/ability_misspelled.golden
+++ b/testdata/ability_misspelled.golden
@@ -1,5 +1,5 @@
╭──────────────────────────────────────╮
-│Error! │
+│✖ Error! │
│Ability not found. │
│• Perhaps a typo? │
│• Missing a hyphen instead of a space?│
diff --git a/testdata/cli_incorrect_command.golden b/testdata/cli_incorrect_command.golden
index f87d825..200015f 100644
--- a/testdata/cli_incorrect_command.golden
+++ b/testdata/cli_incorrect_command.golden
@@ -1,5 +1,5 @@
╭───────────────────────────────────────────────────────────────╮
-│Error! │
+│✖ Error! │
│ 'movesets' is not a valid command. │
│ │
│Commands: │
diff --git a/testdata/item_too_many_args.golden b/testdata/item_too_many_args.golden
index 093717c..7b083ad 100644
--- a/testdata/item_too_many_args.golden
+++ b/testdata/item_too_many_args.golden
@@ -1,4 +1,4 @@
╭──────────────────╮
-│Error! │
+│✖ Error! │
│Too many arguments│
╰──────────────────╯
\ No newline at end of file
diff --git a/testdata/move_misspelled.golden b/testdata/move_misspelled.golden
index 7d02628..93b39d0 100644
--- a/testdata/move_misspelled.golden
+++ b/testdata/move_misspelled.golden
@@ -1,5 +1,5 @@
╭──────────────────────────────────────╮
-│Error! │
+│✖ Error! │
│Move not found. │
│• Perhaps a typo? │
│• Missing a hyphen instead of a space?│
diff --git a/testdata/natures_invalid_extra_arg.golden b/testdata/natures_invalid_extra_arg.golden
index 93450ba..8970f84 100644
--- a/testdata/natures_invalid_extra_arg.golden
+++ b/testdata/natures_invalid_extra_arg.golden
@@ -1,5 +1,5 @@
╭──────────────────────────────────────╮
-│Error! │
+│✖ Error! │
│The only available options after the │
│ command are '-h' or '--help'│
╰──────────────────────────────────────╯
\ No newline at end of file
diff --git a/testdata/pokemon_abilities.golden b/testdata/pokemon_abilities.golden
index 6db91e3..797379d 100644
--- a/testdata/pokemon_abilities.golden
+++ b/testdata/pokemon_abilities.golden
@@ -1,7 +1,10 @@
Your selected Pokémon: Metagross
+
+ Steel Psychic
+
• National Pokédex #: 376
• Weight: 550.0kg (1212.5 lbs)
-• Height: 5.2m (5′03″)
+• Height: 1.6m (5′03″)
─────────
Abilities
Ability 1: Clear Body
diff --git a/testdata/pokemon_help.golden b/testdata/pokemon_help.golden
index 028f720..8201599 100644
--- a/testdata/pokemon_help.golden
+++ b/testdata/pokemon_help.golden
@@ -1,16 +1,16 @@
-╭────────────────────────────────────────────────────────────────────────────╮
-│Get details about a specific Pokémon. │
-│ │
-│ USAGE: │
-│ poke-cli pokemon [flag] │
-│ Use a hyphen when typing a name with a space. │
-│ │
-│ FLAGS: │
-│ -a, --abilities Prints the Pokémon's abilities. │
-│ -i=xx, --image=xx Prints out the Pokémon's default sprite. │
-│ options: [sm, md, lg] │
-│ -m, --moves Prints the Pokemon's learnable moves. │
-│ -s, --stats Prints the Pokémon's base stats. │
-│ -t, --types Prints the Pokémon's typing. │
-│ -h, --help Prints the help menu. │
-╰────────────────────────────────────────────────────────────────────────────╯
\ No newline at end of file
+╭─────────────────────────────────────────────────────────────────────────────────────╮
+│Get details about a specific Pokémon. │
+│ │
+│ USAGE: │
+│ poke-cli pokemon [flag] │
+│ Use a hyphen when typing a name with a space. │
+│ │
+│ FLAGS: │
+│ -a, --abilities Prints the Pokémon's abilities. │
+│ -i=xx, --image=xx Prints out the Pokémon's default sprite. │
+│ options: [sm, md, lg] │
+│ -m, --moves Prints the Pokemon's learnable moves. │
+│ -s, --stats Prints the Pokémon's base stats. │
+│ -t, --types Deprecated. Types are included with each Pokémon. │
+│ -h, --help Prints the help menu. │
+╰─────────────────────────────────────────────────────────────────────────────────────╯
\ No newline at end of file
diff --git a/testdata/pokemon_image.golden b/testdata/pokemon_image.golden
index 7c4cdde..a42575f 100644
--- a/testdata/pokemon_image.golden
+++ b/testdata/pokemon_image.golden
@@ -1,7 +1,10 @@
Your selected Pokémon: Skeledirge
+
+ Fire Ghost
+
• National Pokédex #: 911
• Weight: 326.5kg (719.8 lbs)
-• Height: 5.2m (5′03″)
+• Height: 1.6m (5′03″)
─────
Image
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
diff --git a/testdata/pokemon_image_flag_empty_flag.golden b/testdata/pokemon_image_flag_empty_flag.golden
index ec831c7..408e478 100644
--- a/testdata/pokemon_image_flag_empty_flag.golden
+++ b/testdata/pokemon_image_flag_empty_flag.golden
@@ -1,5 +1,5 @@
╭─────────────────────────────╮
-│Error! │
+│✖ Error! │
│Empty flag '--'. │
│Please specify valid flag(s).│
╰─────────────────────────────╯
\ No newline at end of file
diff --git a/testdata/pokemon_image_flag_missing_size.golden b/testdata/pokemon_image_flag_missing_size.golden
index bfc1940..d5572d4 100644
--- a/testdata/pokemon_image_flag_missing_size.golden
+++ b/testdata/pokemon_image_flag_missing_size.golden
@@ -1,5 +1,5 @@
╭──────────────────────────────────────────────────────────╮
-│Error! │
+│✖ Error! │
│The image flag (-i or --image) requires a non-empty value.│
│Valid sizes are: lg, md, sm. │
╰──────────────────────────────────────────────────────────╯
\ No newline at end of file
diff --git a/testdata/pokemon_image_flag_non-valid_size.golden b/testdata/pokemon_image_flag_non-valid_size.golden
index d74aaea..e2a70b2 100644
--- a/testdata/pokemon_image_flag_non-valid_size.golden
+++ b/testdata/pokemon_image_flag_non-valid_size.golden
@@ -1,11 +1,14 @@
Your selected Pokémon: Floatzel
+
+ Water
+
• National Pokédex #: 419
• Weight: 33.5kg (73.9 lbs)
-• Height: 3.6m (3′07″)
+• Height: 1.1m (3′07″)
─────
Image
╭───────────────────────────╮
-│Error! │
+│✖ Error! │
│Invalid image size. │
│Valid sizes are: lg, md, sm│
╰───────────────────────────╯
diff --git a/testdata/pokemon_no_flags_dual_type.golden b/testdata/pokemon_no_flags_dual_type.golden
new file mode 100644
index 0000000..4c00755
--- /dev/null
+++ b/testdata/pokemon_no_flags_dual_type.golden
@@ -0,0 +1,7 @@
+Your selected Pokémon: Victini
+
+ Psychic Fire
+
+• National Pokédex #: 494
+• Weight: 4.0kg (8.8 lbs)
+• Height: 0.4m (1′04″)
diff --git a/testdata/pokemon_stats.golden b/testdata/pokemon_stats.golden
index 5dda8f7..255d44c 100644
--- a/testdata/pokemon_stats.golden
+++ b/testdata/pokemon_stats.golden
@@ -1,7 +1,10 @@
Your selected Pokémon: Toxicroak
+
+ Poison Fighting
+
• National Pokédex #: 454
• Weight: 44.4kg (97.9 lbs)
-• Height: 4.3m (4′03″)
+• Height: 1.3m (4′03″)
──────────
Base Stats
HP ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 83
diff --git a/testdata/speed_invalid_option.golden b/testdata/speed_invalid_option.golden
index 557a5b5..18fda79 100644
--- a/testdata/speed_invalid_option.golden
+++ b/testdata/speed_invalid_option.golden
@@ -1,5 +1,5 @@
╭────────────────────────────────────╮
-│Error! │
+│✖ Error! │
│The only available options after the│
│ command are '-h' or '--help'│
╰────────────────────────────────────╯
\ No newline at end of file