summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Bump version to 4.10.1HEADv4.10.1masterLee Jarvis2023-02-261-1/+1
|
* Fix booleans without validate_type with argumentsLee Jarvis2023-02-261-0/+5
| | | | | | | | | | If we're not using `validate_type`, we shouldn't try to check a boolean flag's argument to check if it's valid (actually, we probably shouldn't even do that WITH using `validate_type`, but that's a separate issue). For now, this will prevent broken boolean flags. Fixes #279
* Bump version to 4.10.0v4.10.0Lee Jarvis2023-02-151-1/+1
|
* Allow singular form 'validate_type' to be provided to OptionVictor Gama2023-02-151-1/+1
|
* Add optional type validationVictor Gama2023-02-154-3/+54
|
* Bump version to 4.9.3v4.9.3Lee Jarvis2022-09-301-1/+1
|
* Fix explicitly false booleansEugene Otto2022-09-301-1/+3
| | | | | | | | | | | | When a boolean option is explicitly set to `false`, e.g.: ```bash --option=false ``` it enters slop as the string value `'false'`. This commit updates the `BoolOption` option handler to interpret `'false'` and various other falsey values (`false`, `'false'`, `'no'`, `'off'`, `'0'`) as logically false.
* Bump version 4.9.2v4.9.2Lee Jarvis2022-03-261-1/+1
|
* Handle strings containing =Connor Garvey2022-03-101-1/+1
|
* Bump version to 4.9.1v4.9.1Lee Jarvis2021-05-281-1/+1
|
* Add support for --opt="" for blank argumentsLee Jarvis2021-05-281-1/+1
| | | | | | | This is especially useful when your default option value is a non-blank value and you want users to be able to overwrite it with a blank value Closes #266
* Merge pull request #255 from MadBomber/madbomber_frozen_string_exception_fixLee Jarvis2021-05-111-3/+3
|\ | | | | changed str << to str +=
| * changed str << to str +=Dewayne VanHoozer2020-09-051-3/+3
| |
* | Bump version and update changelogLee Jarvis2021-05-111-1/+1
| |
* | 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
|