Permalink
Browse files

Documenting console option parsing behavior.

  • Loading branch information...
1 parent 23d24d1 commit 884af545813f9d738d06230f5b272421dd0c2dc0 @davidpersson davidpersson committed Apr 27, 2012
Showing with 5 additions and 3 deletions.
  1. +4 −2 console/Router.php
  2. +1 −1 console/readme.wiki
View
6 console/Router.php
@@ -16,11 +16,13 @@
class Router extends \lithium\core\Object {
/**
- * Parse incoming request from console
+ * Parse incoming request from console. Short and long (GNU-style) options
+ * in the form of `-f`, `--foo`, `--foo-bar` and `--foo=bar` are parsed.
+ * XF68-style long options (i.e. `-foo`) are not supported but support
+ * can be added by extending this class.
*
* @param object $request lithium\console\Request
* @return array $params
- *
*/
public static function parse($request = null) {
$defaults = array('command' => null, 'action' => 'run', 'args' => array());
View
2 console/readme.wiki
@@ -151,7 +151,7 @@ logic.
Parsing options and arguments to commands should be simple. In fact, the
parsing is already done for you.
-Short and long (GNU-style) options in the form of `-f`, `--foo` and `--foo=bar`
+Short and long (GNU-style) options in the form of `-f`, `--foo`, `--foo-bar` and `--foo=bar`
are automatically parsed and exposed to your command instance through its
properties. XF68-style long options (i.e. `-foo`) are not supported by default
but support can be added by extending the console router.

0 comments on commit 884af54

Please sign in to comment.