ClosestStorm / v8cgi

Automatically exported from code.google.com/p/v8cgi
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

getopt.js doesn't accept long options with dash "-" #117

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up long option with a dash, for example "image-format".
2. Attempt to parse.
3. getopt will report the following error: 

"Error: Cannot parse option '--image-format=png'"

What is the expected output? What do you see instead?

getopt should successfully parse the option.

What version of the product are you using? On what operating system?
r534 of getopt.js (I was looking for a Javascript version of getopt)

Please provide any additional information below.
This can be fixed by changing the regular expression in line 152 to 
/^--([a-zA-Z0-9]+\-)(=(.*))?$/

Original issue reported on code.google.com by vivin.pa...@gmail.com on 27 Jul 2012 at 10:09

GoogleCodeExporter commented 9 years ago
I obviously don't knew how to type. The re should be:

/^--([a-zA-Z0-9\-]+)(=(.*))?$/

Original comment by vivin.pa...@gmail.com on 27 Jul 2012 at 11:05

GoogleCodeExporter commented 9 years ago

Original comment by ondrej.zara on 30 Jul 2012 at 6:53

GoogleCodeExporter commented 9 years ago
Fixed in http://code.google.com/p/teajs/issues/detail?id=7.

v8cgi is now known as TeaJS; please switch to that project :-)

Original comment by ondrej.zara on 30 Jul 2012 at 7:04