Skip to content

Commit 71d7cc7

Browse files
updating error messaging
1 parent 20c7ac8 commit 71d7cc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/utils/validateargs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,19 @@ func ValidatePokemonArgs(args []string) error {
121121
// Validate each argument after the Pokémon's name
122122
if len(args) > 3 {
123123
for _, arg := range args[3:] {
124-
// Check for single `-` or `--` which are invalid
124+
// Check for an empty flag after Pokémon's name
125125
if arg == "-" || arg == "--" {
126126
errorTitle := styling.ErrorColor.Render("Error!")
127127
errorString := fmt.Sprintf(
128-
"\nInvalid argument '%s'. Single '-' or '--' is not allowed.\nPlease use valid flags.",
128+
"\nEmpty flag '%s'.\nPlease specify valid flag(s).",
129129
arg,
130130
)
131131
finalErrorMessage := errorTitle + errorString
132132
renderedError := styling.ErrorBorder.Render(finalErrorMessage)
133133
return fmt.Errorf("%s", renderedError)
134134
}
135135

136-
// Check if the argument starts with a flag prefix but is invalid
136+
// Check if the argument after Pokémon's name is an attempted flag
137137
if arg[0] != '-' {
138138
errorTitle := styling.ErrorColor.Render("Error!")
139139
errorString := fmt.Sprintf(

0 commit comments

Comments
 (0)