On Fri, Jan 7, 2011 at 10:41 AM, la...@garfieldtech.com <
la...@garfieldtech.com> wrote:

> "Application" is perhaps a misnomer.  I'm not looking at rewriting Emacs or
> anything.  Just some batch processing that would get run as:
>
> php myscript.php --config=foo.xml --setting-1=stuff


For this I used getopt() which worked well enough. Long options don't work
on Windows IIRC (check the docs), but you can easily get arguments from
short options. An example for the tool I wrote is

    src/sitemap.php -s 28372 -d mydomain.com -l debug -p -z 9 -b sitemaps -o
xml

The code that parses the options is very straightforward. If you already use
Zend Framework, it has its own CLI library I think.

David

Reply via email to