Граф коммитов

203 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 5d76fe6b2a [ruby/optparse] Invoke pager for `--help`
https://github.com/ruby/optparse/commit/77dccce37c
2024-03-01 07:10:08 +00:00
Nobuyoshi Nakada 7da3f8dcd3 [ruby/optparse] [DOC] About return value of OptionParser#new
https://github.com/ruby/optparse/commit/59b9fd7ddc
2024-02-23 12:50:08 +00:00
Nobuyoshi Nakada 41c0fb6991 [ruby/optparse] Add `exact:` keyword argument
https://github.com/ruby/optparse/commit/07e83673a8
2024-02-23 21:16:59 +09:00
Yusuke Endoh 25d74b9527 Do not include a backtick in error messages and backtraces
[Feature #16495]
2024-02-15 18:42:31 +09:00
Nobuyoshi Nakada bbccabe6d6 [ruby/optparse] [DOC] Add missing documents
https://github.com/ruby/optparse/commit/33956ce93f
2024-02-11 16:08:14 +00:00
Nobuyoshi Nakada f960fbc102 [ruby/optparse] Search exactly when `require_exact`
To work with options defined as `--[no]-something`.

Fix https://bugs.ruby-lang.org/issues/20252
Fix https://github.com/ruby/optparse/pull/60

https://github.com/ruby/optparse/commit/78afdab307
2024-02-11 00:47:41 +09:00
Nobuyoshi Nakada db73226bf6 [ruby/optparse] Adjust arguments for lambda-callbacks
Rake uses [lambda] as callbacks.
Calling it without omitted argument raises an `ArgumentError`.

lambda: https://github.com/ruby/rake/blob/master/lib/rake/application.rb#L543

https://github.com/ruby/optparse/commit/213cb03b59
2024-02-09 19:58:31 +09:00
Nobuyoshi Nakada 2c6767b71e [ruby/optparse] Respect default values in block parameters
Fix https://github.com/ruby/optparse/pull/55

https://github.com/ruby/optparse/commit/9d53e74aa4
2024-02-09 19:58:19 +09:00
fatkodima f7a407cabd [ruby/optparse] Fix `require_exact` to work with options defined as `--[no]-something`
https://github.com/ruby/optparse/commit/4e346ad337
2024-02-09 03:31:13 +00:00
Nobuyoshi Nakada 50bcaa6286 [ruby/optparse] Escape backslashes
https://github.com/ruby/optparse/commit/b14c2c644d
2024-02-09 03:21:24 +00:00
Nobuyoshi Nakada e55a57af1e [ruby/optparse] [DOC] Add missing documents
https://github.com/ruby/optparse/commit/324ff21f04
2023-12-25 21:12:49 +09:00
Hiroshi SHIBATA 3f33bfa1e5 [ruby/optparse] Bump up 0.4.0
https://github.com/ruby/optparse/commit/acbf6e3e12
2023-11-07 01:40:53 +00:00
Nobuyoshi Nakada dfad14d83f [ruby/optparse] [DOC] Mark up constant and method names as code
https://github.com/ruby/optparse/commit/e8bee0be8f
2023-07-30 02:35:22 +00:00
Jeremy Evans bb927acd3b [ruby/optparse] Document requires needed for Date/DateTime/Time/URI/Shellwords support
Fixes [Bug #19566]

https://github.com/ruby/optparse/commit/fb91d97c10
2023-04-04 23:43:58 +00:00
Junichi Ito cea6951ecf [ruby/optparse] Add symbolize_names to getopts
https://github.com/ruby/optparse/commit/3e63d878f8
2022-12-26 15:09:21 +09:00
Nobuyoshi Nakada 4c767c1354 [ruby/optparse] bump up to 0.4.0.pre.1
https://github.com/ruby/optparse/commit/73661899ad
2022-12-26 15:09:21 +09:00
Hiroshi SHIBATA fe7190a8c1
[ruby/optparse] Bump version to 0.3.1
https://github.com/ruby/optparse/commit/2a1e157ae1
2022-12-22 17:48:22 +09:00
Nobuyoshi Nakada 502ca37dde [ruby/optparse] The encoding argument of `Regexp.new` has been ignored since 1.9
https://github.com/ruby/optparse/commit/766f567405
2022-12-21 14:09:12 +09:00
Hiroshi SHIBATA 71b4d35526 [ruby/optparse] Bump version to 0.3.0
https://github.com/ruby/optparse/commit/c80dfb1ebd
2022-12-05 07:17:23 +00:00
Nobuyoshi Nakada 0bfb185654 [ruby/optparse] Add `raise_unknown` flag
(https://github.com/ruby/optparse/pull/38)

https://github.com/ruby/optparse/commit/12529653cd
2022-11-28 14:24:06 +00:00
Nobuyoshi Nakada e2b15461a7 [ruby/optparse] Use class methods of `File` over `IO`
https://github.com/ruby/optparse/commit/ab5073e4d8
2022-11-21 10:26:42 +00:00
Whyme Lyu 37291df91d [ruby/optparse] #load() into hash
(https://github.com/ruby/optparse/pull/42)

OptionParser#load learns .load(into: Hash)

https://github.com/ruby/optparse/commit/2ea626fcff

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-10-29 13:46:27 +00:00
Maciek Rząsa 0f231f2bab [ruby/optparse] Don't treat empty string as an option description
https://github.com/ruby/optparse/commit/078638ee6d
2022-10-08 19:30:34 +09:00
konsolebox 419ad1e13e [ruby/optparse] Also accept '-' as an optional argument (https://github.com/ruby/optparse/pull/35)
https://github.com/ruby/optparse/commit/f2b8318631
2022-07-29 19:10:10 +09:00
Nobuyoshi Nakada de427c3ce0 [ruby/optparse] Define `inspect` and `pretty_inspect`
https://github.com/ruby/optparse/commit/a3f0ec21b1
2022-04-04 15:05:44 +09:00
Nobuyoshi Nakada 92630e2346
[ruby/optparse] Fix links to the page directory files [Bug #18468]
https://github.com/ruby/optparse/commit/dab72c543d
2022-01-12 21:16:02 +09:00
Hiroshi SHIBATA b8d49d0d01 [ruby/optparse] Bump up optparse version to 0.2.0
https://github.com/ruby/optparse/commit/1226b670e6
2021-10-21 21:01:34 +09:00
Burdette Lamar 27679b349e
[ruby/optparse] More on tutorial (https://github.com/ruby/optparse/pull/23)
- Removed a largish block of repeated text.
- Added sections "Top List and Base List" and "Methods for Defining Options" (on, define, etc.).
- Linked from class OptionParser doc to the tutorial.

https://github.com/ruby/optparse/commit/7f3195b9db
2021-07-28 20:13:39 +09:00
Nobuyoshi Nakada bf175e7ec2
[ruby/optparse] nodoc private methods
https://github.com/ruby/optparse/commit/f23d750d14
2021-07-28 20:13:38 +09:00
Nobuyoshi Nakada f89486965b [ruby/optparse] Moved rdoc files to doc/optparse
https://github.com/ruby/optparse/commit/cccb28e0de
2021-04-11 09:03:36 +09:00
BurdetteLamar a5ecce9187
[ruby/optparse] Make use of option_params.rdoc
https://github.com/ruby/optparse/commit/d55d9284c3
2021-04-08 12:11:42 +09:00
Nobuyoshi Nakada 190a57b168
[ruby/optparse] bump up to 0.1.1
https://github.com/ruby/optparse/commit/2fe984a603
2021-03-29 19:37:25 +09:00
Nobuyoshi Nakada e8317d90b0
[ruby/optparse] Fixed error message of unparsed non-option
Close https://github.com/ruby/optparse/issues/3

https://github.com/ruby/optparse/commit/94c5cf4032
2021-03-29 19:37:24 +09:00
BurdetteLamar 7846f3201a
[ruby/optparse] Change *opts to *params, to avoid confusion
https://github.com/ruby/optparse/commit/f5f5e202dd
2021-03-29 15:55:41 +09:00
Jeremy Evans eca8ffaa0b
[ruby/optparse] Add OptionParser#require_exact accessor
This allows you to disable allowing abbreviations of long options
and using short options for long options.

Implements Ruby Feature #11523

https://github.com/ruby/optparse/commit/dfefb2d2e2
2021-03-29 15:55:41 +09:00
Nobuyoshi Nakada 3198e7abd7
Separate `send` into `public_send` and `__send__` 2020-10-27 16:12:45 +09:00
Nobuyoshi Nakada f120e65200 [ruby/optparse] Define OptionParser::Version
https://github.com/ruby/optparse/commit/4c0021b5b2
2020-07-23 10:57:33 +09:00
Nobuyoshi Nakada fb6a489af2
Revert "Method reference operator"
This reverts commit 67c5747369.
[Feature #16275]
2019-11-12 17:24:48 +09:00
zverok f93cb6904c OptionParser: document into: argument 2019-10-26 10:24:20 -07:00
Nobuyoshi Nakada 263ee6639d
Make suggestions order stable [Bug #16263]
As the result order of `DidYouMean::SpellChecker#correct` is
undefined, keep the order of the original candidates.
2019-10-21 09:54:11 +09:00
Nobuyoshi Nakada e2b719bed6
Support DidYouMean by AmbiguousOption too 2019-10-18 17:46:53 +09:00
Nobuyoshi Nakada b4d308b419
Defer adding additional info until getting the message of an error 2019-10-18 17:39:16 +09:00
Nobuyoshi Nakada 46fa301e82
Use DidYouMean.formatter
Instead of building messages separately.
2019-10-18 15:18:36 +09:00
Yusuke Endoh c3b64a86bc lib/optparse.rb: Show a did_you_mean hint for unknown option
```
require 'optparse'

OptionParser.new do |opts|
  opts.on("-f", "--foo", "foo") {|v| }
  opts.on("-b", "--bar", "bar") {|v| }
  opts.on("-c", "--baz", "baz") {|v| }
end.parse!
```

```
$ ruby test.rb --baa
Traceback (most recent call last):
test.rb:7:in `<main>': invalid option: --baa (OptionParser::InvalidOption)
Did you mean?  baz
               bar
```
2019-10-18 12:20:58 +09:00
Jeremy Evans 3fcffceafd Fix default argument values for OptParse::Switch#summarize
The documentation describes these arguments being hashes, and the method
is called with hashes, so a hash default makes more sense.

The method would fail previously if called without arguments and @short
or @long contained a non-integer value.

Fixes [Bug #10928]
2019-07-07 13:49:47 -07:00
Nobuyoshi Nakada 7e72ce0f73
Load OptionParser defaults from XDG and Haiku standards 2019-05-06 15:30:44 +09:00
kazu c01a5ee85e Use delete_prefix instead of `sub(/\Afixed-pattern/, '')`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 08:22:10 +00:00
nobu a7f1bcb2d6 optarse.rb: mention multiple descriptions [ci skip]
[ruby-list:50718]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-02 12:50:19 +00:00
nobu 2d67a3f4b1 Get rid of block-less Proc.new
* lib/optparse.rb (OptionParser::Switch#initialize): get rid of
  `Proc.new` without a block, which may be deprecated in the future.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28 06:12:58 +00:00
nobu b7fccecf1c Remove useless backslash
* lib/optparse.rb (OptionParser::Switch#compsys): remove useless
  backslash which just confuse ruby-mode.el.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28 06:12:57 +00:00