summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add symbols to option typesJoe Gracyk2021-05-101-0/+7
|
* Bump version to 4.8.2v4.8.2Lee Jarvis2020-07-101-1/+1
|
* Fix bug with separators around `help: false` optsLee Jarvis2020-07-101-2/+2
| | | | | | | | | | | The separators rely on the indexes of the options before/after them, but we ignore `help: false` options when building the help string, so all of the positions are messed up. This change avoids ignoring those options during the iteration, and instead just doesn't append the option help to the string. Fixes #253
* Bump version to 4.8.1v4.8.1Lee Jarvis2020-03-311-1/+1
|
* Fix one more keyword argument warningTeemu Matilainen2020-01-281-1/+1
|
* Bump version to v.8.0v4.8.0Lee Jarvis2020-01-171-1/+1
|
* admit commentsHansuk2020-01-171-1/+3
| | | | | | | - https://github.com/leejarvis/slop/pull/250#discussion_r367361652 - https://github.com/leejarvis/slop/pull/250#discussion_r367420001 Signed-off-by: Hansuk <flavono123@gmail.com>
* support scientific nations for float optionsHansuk2020-01-161-2/+1
| | | | | | | - reference: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly - remove the todo comment(no idea for etc) Signed-off-by: Hansuk <flavono123@gmail.com>
* support + sign for float optionsHansuk2020-01-161-1/+1
| | | | Signed-off-by: Hansuk <flavono123@gmail.com>
* Tests on Ruby 2.7.0Juha Ylitalo2020-01-071-4/+4
|
* remove unused variableTyler Mercier2019-10-221-1/+0
|
* Support '+' as prefix for integerJuha Ylitalo2019-08-231-1/+1
|
* Bump version to 4.7.0v4.7.0Lee Jarvis2019-06-291-1/+1
|
* Fix a bug that flag value is processed as flagSutou Kouhei2019-06-291-1/+8
| | | | | | | | 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.
* Allow calling `Options#separator` without args, defaulting to an empty stringTeemu Matilainen2019-01-201-1/+1
| | | | | | | | It's clear that we want an empty line when calling `opts.separator` without arguments. Leave the examples in the Readme still for a while with the empty string to avoid confusion when using older versions.
* add Slop::Result#fetchGiovanni Benussi2018-06-272-9/+24
| | | | | | | | | | | | | | | | | | | | | | use Slop::Result#clean_key in Slop::Result#option fix typo in Slop::Result#[] and Slop::Result#fetch descriptions handle case when Slop::Result#fetch tries to fetch an option that is not provided and does not have a default value raise Slop::UnknownOption when Slop::Result#fetch tries to fetch an unexisting key set Slop::Result#clean_key method as private remove redundant Slop::Result#fetch tests update description of Slop::Result#fetch test when trying to access an unexisting option update error message when an option is not present on Slop::Result#fetch description of Slop::Result#fetch update expected error message on test for Slop::Result#fetch when an option is not present
* Bump version to 4.6.2v4.6.2Lee Jarvis2018-03-121-1/+1
| | | | Closes #226
* Handle equals character for non-option valuespedantic-equalsLee Jarvis2018-03-121-2/+2
| | | | | | | 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
* Bump version to v4.6.1v4.6.1Lee Jarvis2017-11-201-1/+1
|
* Add more tests for Options#separatorLee Jarvis2017-11-171-0/+4
| | | | | | And fixed the inevitable missed last separator.. Fixes #222
* Fix separator so it doesn't mutate user dataMarc-Andre Lafortune2017-11-131-1/+1
|
* Bump version to 4.6.0v4.6.0Lee Jarvis2017-10-061-1/+1
| | | | includes (closes #218)
* Support for required optionsWilliam Woodruff2017-09-293-0/+20
| | | | | | | | | | | This commit introduces support for required options, which are options that cause the parser to raise a `MissingRequiredOption` exception if not present. Options can be marked as required by passing `required: true` in their configuration, and any errors caused by missing required options can be suppressed via `suppress_errors: true`.
* Fix bug preventing '--' being passed as the first argument.Thomas Bénéteau2017-08-051-0/+1
|
* Bump version to 4.5.0v4.5.0Lee Jarvis2017-05-221-1/+1
|
* Merge tag 'v4.4.3'Lee Jarvis2017-05-021-1/+1
|\ | | | | | | Version 4.4.3
| * Bump version to 4.4.3v4.4.3v4.4.3Lee Jarvis2017-05-021-1/+1
| |
| * Fix Ruby 2.0.0 broken `private def ...`Lee Jarvis2017-05-021-1/+1
| | | | | | | | and re-add to the CI
* | Fix Ruby 2.0.0 broken `private def ...`Lee Jarvis2017-05-021-1/+1
| | | | | | | | and re-add to the CI
* | Add config option underscore_flagslbriais-feature/add_config_for_underscore_switchLaurent B2017-05-013-5/+18
|/ | | | | | | | | | | | | | The default behaviour of translation flags-with-dashes is to underscore them so they're symbol friendly. This config option allows us to avoid this translation and simply return the flags verbatim: opts = Slop.parse(underscore_flags: false) do |o| o.on "--foo-bar" end opts.to_hash #=> { :"foo-bar" => true } closes #204
* Bump version to 4.2.2v4.4.2Lee Jarvis2017-04-291-1/+1
|
* Avoid deleting args after '--'Lee Jarvis2017-04-291-6/+14
| | | | | | | | 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-7/+20
| | | | | | | Thanks to @RickHull for the "smashing" terminology and various conversations Fixes #199
* Bump version to 4.4.1v4.4.1Lee Jarvis2016-08-211-1/+1
|
* Handle bad constant names in Slop.option_defined?Lee Jarvis2016-08-211-0/+4
| | | | Closes #198
* Bump version 4.4.0v4.4.0Lee Jarvis2016-08-151-1/+1
|
* Merge pull request #193 from kch/order-fixLee Jarvis2016-04-151-1/+1
|\ | | | | inside tail sort, retain original sort order
| * inside tail sort, retain original sort orderCaio Chassot2016-04-141-1/+1
| |
* | Support arguments to options with leading -Andrew Clemons2016-04-042-3/+11
|/ | | | | | | | This allows negative values as arguments to numeric options and strings starting with - for any other type. Fixes #170 Fixes #179
* Bump version to 4.3.0v4.3.0Lee Jarvis2016-03-191-1/+1
|
* Can specify a custom banner string in Options via configPhil Rees2016-03-181-1/+1
|
* Allow disabling the delimiter for array argumentsMike Pastore2016-02-181-2/+6
|
* Bump version 4.2.1v4.2.1Lee Jarvis2015-11-251-1/+1
|
* Fix bug where true is passed to BoolOption block regardless of --no- prefixBen Brady2015-11-241-2/+1
|
* Fix bug regarding --foo=bar style optionsNaoki Mizuno2015-09-081-3/+6
| | | | | | | | | | 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.
* Use each_with_index for looping over argumentsNaoki Mizuno2015-09-081-13/+3
|
* Fix arguments removed with option argumentsNaoki Mizuno2015-09-081-1/+16
| | | | See #181.
* #163 only raise MissingArgument if not default_valueBen Brady2015-06-301-3/+8
|
* Simplify checking for grouped short flagsLee Jarvis2015-06-201-1/+1
|
* Bump version v4.2.0v4.2.0Lee Jarvis2015-06-181-1/+1
|