func (this HelpShower) Execute(request *io.Request, response *io.Response) { var helpData help.Container if request.InteractorNameEmpty() { helpData = help.CreateGeneralHelpContainer(*this.locator) response.AddError(errors.New("No interactor name provided")) } else { interactor := this.locator.GetInteractorByName(request.InteractorName) if &interactor == nil { response.AddErrorMessage("Cannot show help for an unknown interactor " + request.InteractorName) return } helpData = help.CreateInteractorHelpContainer(interactor) } helpResponseCreator := &help.HelpResponseCreator{} helpResponseCreator.CreateHelpResponse(helpData) }
func (this *Validator) isInteractorEmpty(request *io.Request) bool { _, hasHelpOption := request.GetUniversalParamString("h") return !hasHelpOption && request.InteractorNameEmpty() }