Skip to content

Commit b0caad1

Browse files
adding better usage examples (#109)
1 parent 3bb7049 commit b0caad1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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
}

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
}

0 commit comments

Comments
 (0)