PHP-Daemon icon indicating copy to clipboard operation
PHP-Daemon copied to clipboard

Make it easier for developers to add their own Help documentation

Open shaneharter opened this issue 12 years ago • 0 comments

Refactor the Core_Daemon::show_help() method to work like show_install_instructions().

Create two instance vars on Core_Daemon:

protected $help_usage = array();
protected $help_options = array();

Change the Core_Daemon::getopt() method to write to these arrays. Change the show_help() method to just implode these arrays and print them with a similar format to the existing code.

This will enable application developers to parse their own command line options by overloading getopt (and calling parent::getopt() when they're done), while writing help instructions that get displayed alongside the library-specific instructions.

shaneharter avatar Jun 11 '12 02:06 shaneharter