PHP: Getting options from cmd-line argument list: Standard?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jeff00seattle
Forum Commoner
Posts: 66
Joined: Sat Feb 28, 2009 3:27 pm

PHP: Getting options from cmd-line argument list: Standard?

Post by jeff00seattle »

Hi

Is there a PHP standard at to expected option handling from command-line argument list?

I look at PHP getopt(), and it is not enough for me. I do not like that I have to use a single character to define each option, because I prefer a single more discriptive word instead for each option.

However, not to displease the PHP community when creating a command-line utility, I want to know if...
  1. Is getopt() the standard?
  2. Must I begin each option with a dash(-) ?
  3. Must I use a single character to define an option?
  4. What is the expected delimiter when an option is provided multiple values? Some use semicolons, for example foo.php has an option "bar" with three values "a, b, & c": "foo.php -bar:a;b;c"
Thanks

Jeff in Seattle
Post Reply