summaryrefslogtreecommitdiff
path: root/test/parser_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug that flag value is processed as flagSutou Kouhei2019-06-291-0/+6
| | | | | | | | If flag value starts with "-", unknown option error is raised. The current flag value check is "orig_arg == opt.value.to_s". There are some objects such as Regexp and Time that input value and its #to_s aren't same.
* Handle equals character for non-option valuespedantic-equalsLee Jarvis2018-03-121-0/+5
| | | | | | | If the string includes an equals char but doesn't look like it's a possible candidate for a flag=value, we should ignore it see #226
* Avoid deleting args after '--'Lee Jarvis2017-04-291-1/+2
| | | | | | | | Everything after -- is sacred and shouldn't be mutated. So lets just remove it all straight away and add it to our arguments list after we're done parsing Closes #194
* Fix support for parsing -x5Lee Jarvis2017-01-291-0/+13
| | | | | | | Thanks to @RickHull for the "smashing" terminology and various conversations Fixes #199
* Support arguments to options with leading -Andrew Clemons2016-04-041-0/+21
| | | | | | | | This allows negative values as arguments to numeric options and strings starting with - for any other type. Fixes #170 Fixes #179
* Fix bug regarding --foo=bar style optionsNaoki Mizuno2015-09-081-0/+5
| | | | | | | | | | This fixes the bug introduced in ebe678b1639654604b3e54b08ca710c38682b83e where the argument after a flag is naively deleted. For example, with --foo=bar baz , both `--foo=bar' and `baz' are deleted when only `--foo=bar' should be deleted.
* Fix arguments removed with option argumentsNaoki Mizuno2015-09-081-0/+5
| | | | See #181.
* Remove "--" from the unprocessed argumentsDavid Rodríguez2015-01-111-0/+5
| | | | | The double dash is a valid (special) option for Slop, so like the rest of the options successfully processed, should be removed.
* Reset parser every time parse is calledLee Jarvis2014-12-301-5/+5
|
* Add result/parser `arguments` methodLee Jarvis2014-12-191-0/+6
|
* Handle short grouped flagsLee Jarvis2014-11-191-1/+12
|
* Support flag=argLee Jarvis2014-11-191-0/+19
|
* Ignore everything after -- and reset the parserLee Jarvis2014-11-191-0/+5
|
* Expose used/unused options in parserLee Jarvis2014-11-191-0/+24