c9s / GetOptionKit

An object-oriented option parser library for PHP, which supports type constraints, flag, multiple flag, multiple values, required value checking

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not enter negative numbers

vasek125 opened this issue · comments

If number begins with -, it is treated as an option. Current workaround: use something like: -o " -1" because -o "-1" will not work.

Looks like the logic needs to be fixed in the below flow:

  • see if -1 option exists
  • if not, check the previous option -o requires a value?
  • if -o requires a value, pass -1 value to -o option.

makes sense?

reasonable

Hi @Gasol , @vasek125 I just fixed it, give it a try with dev-master ?

Looks good to me.

OK I will release this changes in the next minor version.

@c9s I think next minor version should also change autoload from psr-0 to psr-4, Because psr-0 is deprecated.

sure :)

👍

Updated and Released!

I am closing. :)