setup parser
This commit is contained in:
@ -13,8 +13,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
learningTypeOptName = "learning_type"
|
||||
courseThematicOptName = "course_thematic"
|
||||
learningTypeOptName = "learning-type"
|
||||
courseThematicOptName = "course-thematic"
|
||||
)
|
||||
|
||||
func setupAPICommand(ctx context.Context) cli.Command {
|
||||
@ -98,13 +98,11 @@ func (a *listProductsAction) parse(args []string, options map[string]string) err
|
||||
|
||||
a.params.learningType, ok = options[learningTypeOptName]
|
||||
if !ok {
|
||||
return errors.SimpleError("learning_type is empty")
|
||||
}
|
||||
a.params.courseThematic, ok = options[courseThematicOptName]
|
||||
if !ok {
|
||||
return errors.SimpleError("course_thematic is empty")
|
||||
return errors.SimpleError(learningTypeOptName + " is empty")
|
||||
}
|
||||
|
||||
a.params.courseThematic = options[courseThematicOptName]
|
||||
|
||||
if value, ok := options[limitOption.Key()]; ok {
|
||||
a.params.limit, _ = strconv.Atoi(value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user