| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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
|
|\
| |
| | |
changed str << to str +=
|
| | |
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
| |
Signed-off-by: Hansuk <flavono123@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Closes #226
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
And fixed the inevitable missed last separator..
Fixes #222
|
| |
|
|
|
|
| |
includes (closes #218)
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
| |
|
| |
|
|\
| |
| |
| | |
Version 4.4.3
|
| | |
|
| |
| |
| |
| | |
and re-add to the CI
|
| |
| |
| |
| | |
and re-add to the CI
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Thanks to @RickHull for the "smashing" terminology and various
conversations
Fixes #199
|
| |
|
|
|
|
| |
Closes #198
|
| |
|
|\
| |
| | |
inside tail sort, retain original sort order
|
| | |
|
|/
|
|
|
|
|
|
| |
This allows negative values as arguments to numeric options and strings
starting with - for any other type.
Fixes #170
Fixes #179
|
| |
|
| |
|