rapidsms/rapidsms — pull request #315 by ewheeler (2013-03-12 10:00:46+00:00)
Title: generate help menus for installed handlers

I've always wanted rapidsms to include a unified `help` system so that users can query for usage instructions and to allow for service discovery.

The usage of handlers in https://github.com/caktus/rapidsms-appointments/tree/master/appointments/handlers introduces a great prefix+keyword pattern that really makes it easy to generate a useful `help` system for all installed handlers.

# `help` constructs a response enumerating all handler keywords and prefix+keyword pairs
>> help
<< Available actions: LANGUAGE|LANG, REGISTER|REG|JOIN, ECHO, APPT CONFIRM, APPT MOVE, APPT NEW, APPT QUIT, APPT STATUS

# `help PREFIX` constructs a response enumerating all keywords for the given prefix namespace
>> help appt
<< Available APPT keywords: NEW, QUIT, STATUS, CONFIRM, MOVE

# `help PREFIX KEYWORD` constructs a response using the handler's help_text attribute
>> help appt new
<< To add a user a timeline send: APPT NEW . The date is optional.

I don't think the functionality in this pull request is final, but I think it can serve as an initial example implementation. A standardized API for both apps and handlers should be established so that other apps' help information can be provided by a unified global help system.