Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 letter short options don't work as documented #3

Closed
jhirbour opened this issue Apr 17, 2013 · 2 comments
Closed

2 letter short options don't work as documented #3

jhirbour opened this issue Apr 17, 2013 · 2 comments

Comments

@jhirbour
Copy link

I added the following to the the demo.php file.

opt->add( 'za|zooa?' , 'option with optional value. za' );

You can retrieve the value if I use the long option:

php demo.php -f 1 -z 1 --zooa 1

If you try and retrieve the value using the short form you get "Invalid option -a"

php demo.php -f 1 -z 1 -za 1
@c9s
Copy link
Owner

c9s commented Apr 18, 2013

The option like -abc which is a combined options from:

opt->add( 'a|foo' , 'option with optional value. a' );
opt->add( 'b|bar' , 'option with optional value. b' );
opt->add( 'c|bar' , 'option with optional value. c' );

which is just like we use the grep options today:

  grep -irl [pattern] [file]

@jhirbour
Copy link
Author

Oh! there's the confusion. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants