diff --git a/cli.php b/cli.php index bed43d0..4ae1c44 100644 --- a/cli.php +++ b/cli.php @@ -159,6 +159,17 @@ $cli->run(); */ $argv[$key] = file_get_contents ("php://stdin"); } + // Convert "toto=ror&ypyp=oo" arg to array("toto"=>"ror","ypyp"=>"oo") + // (Array management in CLI) + foreach ($argv as $key=>$arg) + { + $val = null; + parse_str ($arg, $val); + if (count ($val) === 1 && reset ($val) === "") + $val = $arg; + $argv[$key] = $val; + } + // TODO : Manage a parameter in the constructor of the class try { diff --git a/docs/USAGE b/docs/USAGE index 9b3e8ce..045a1dd 100644 --- a/docs/USAGE +++ b/docs/USAGE @@ -161,7 +161,12 @@ The screen will display the actions to help the debug : XX. CLI usage ------------- The DomFramework is designed to be used in console line too. -TBC !! +You can pass the arguments like a string or an array with this syntax : +./cli/cli.php +Example : ./cli/cli.php zones update data1 data2 "zone=newvalue1¶m4=new" + +It is possible to have one dash (-) in the parameters. In this case, the +informations are readed from the stdin. XX. Modular application -----------------------