-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
improvementImprovement to an existing feature.Improvement to an existing feature.refactorRefactoring existing code.Refactoring existing code.
Description
All provided commands are ran through the validation functions in cmd/validateargs.go file.
Currently, in v0.7.0, both the pokemon and types commands are checked for a -h or --help flag in `os.Args[2].
To reduce redundancy, a helper method can be created then used throughout the validation functions. This will continue to provide clean code when new commands are added.
For example:
func handleHelpFlag(args []string) {
if len(args) == 3 && (args[2] == "-h" || args[2] == "--help") {
flag.Usage()
if flag.Lookup("test.v") == nil {
os.Exit(0)
}
}
}Metadata
Metadata
Assignees
Labels
improvementImprovement to an existing feature.Improvement to an existing feature.refactorRefactoring existing code.Refactoring existing code.
Projects
Status
Completed