Nobuyoshi Nakada
f76ce9fd28
[ruby/optparse] Use ~/.config
only if $XDG_CONFIG_HOME
is unset or empty
...
2f9c7500a3
2025-08-08 10:39:20 +00:00
Nobuyoshi Nakada
deb0240ea0
[ruby/optparse] Expand literal home paths only
...
Paths in environment variables should already be expanded.
The base name of the program is also not subject to expansion.
181752391c
2025-08-03 13:53:27 +00:00
Nobuyoshi Nakada
9598ed9d1c
[ruby/optparse] JRuby does not have EXECUTABLE_EXTS in RbConfg::CONFIG
...
15b2f00b6b
2025-06-29 07:52:46 +00:00
Nobuyoshi Nakada
259b0233d8
[ruby/optparse] Fix OptionParser#program_name not to strip suffix unexpectedly
...
740ffa76c0
2025-06-29 07:52:45 +00:00
kwatch
9fd793e0bd
[ruby/optparse] Enhance to support 'Set' object as an enum
...
(https://github.com/ruby/optparse/pull/76 )
* Enhance to support 'Set' object as an enum
* Add test script for '#make_swithc()'
---------
3869000e98
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2025-06-29 07:30:58 +00:00
Nobuyoshi Nakada
265dcd1733
[ruby/optparse] bump up to 0.7.0.dev.2
...
8c2c7a4903
2025-03-19 08:00:01 +00:00
Nobuyoshi Nakada
8f19f0aad5
[ruby/optparse] Fix completion of key-value pairs array
...
Enum array may be the list of pairs of key and value. Check if only
key is completable, not pair.
Fix https://github.com/ruby/optparse/pull/93
Fix https://github.com/ruby/optparse/pull/94
a8d0ba8dac
2025-03-17 10:18:49 +00:00
Nobuyoshi Nakada
97c133a859
[ruby/optparse] bump up to 0.7.0.dev.1 [ci skip]
...
f4d64b0b17
2025-03-10 11:06:55 +00:00
Kouhei Yanagita
3cd3f76679
[ruby/optparse] Fix LESS environment variable setup in OptionParser#help_exit
...
If the original value of LESS ends with an option starting with "--",
simply appending "Fe" would result in an invalid option string.
30571f91d3
2025-03-10 10:21:29 +00:00
Koichi ITO
f4c16c57aa
[ruby/optparse] Make the result of tty?
obtainable with flexible stdout
...
In mock testing for stdout, `StringIO.new` is sometimes used to redirect the output.
In such cases, the assignment is done with `$stdout = StringIO.new`, not the constant `STDOUT`.
e.g., https://github.com/rubocop/rubocop/blob/v1.71.1/lib/rubocop/rspec/shared_contexts.rb#L154-L164
After assigning `StringIO.new`, `$stdout.tty?` returns `false`,
allowing the standard output destination to be switched during test execution.
```ruby
STDOUT.tty? # => true
StringIO.new.tty? # => false
```
However, since `STDOUT.tty?` returns `true`, a failure occurred in environments
where the environment variables `RUBY_PAGER` or `PAGER` are set.
e.g., https://github.com/rubocop/rubocop/pull/13784
To address this, `STDOUT` has been updated to `$stdout` so that the result of `tty?` can be flexibly overridden.
A potential concern is that `$stdout`, unlike `STDOUT`,
does not always represent the standard output at the time the Ruby process started.
However, no concrete examples of issues related to this have been identified.
`STDOUT.tty?` is the logic of optparse introduced in https://github.com/ruby/optparse/pull/70 .
This PR replaces `STDOUT` with `$stdout` throughout, based on the assumption
that `$stdout` is sufficient for use with optparse.
262cf6f9ac
2025-03-10 10:19:58 +00:00
Nobuyoshi Nakada
9e265b583b
[ruby/optparse] Add post-check of value
...
Fix https://github.com/ruby/optparse/pull/80
050a87d029
2025-03-10 09:55:29 +00:00
Nobuyoshi Nakada
b51450f3bd
[ruby/optparse] Update argument check with save navigation operator
...
71e2b31824
2025-03-10 08:03:55 +00:00
Nobuyoshi Nakada
dad0f876a9
[ruby/optparse] Remove extra blank lines [ci skip]
...
d7dec6808f
2025-03-10 08:03:54 +00:00
Nobuyoshi Nakada
9de9cb53c0
[ruby/optparse] [DOC] Update documents to use single quotes instead of backqoutes
...
5e71a70cb5
2025-03-10 07:56:44 +00:00
Nobuyoshi Nakada
cdf36d6bfd
[ruby/optparse] Allow non-string enum list #79
...
Command line arguments are strings, convert enum list elements to
strings to match.
c5ec052efc
2025-03-09 14:32:17 +00:00
Nobuyoshi Nakada
0c73328aff
[ruby/optparse] Use \A
instead of ^
as the beginning of string
...
a3f1029815
2025-03-09 14:09:16 +00:00
Hiroshi SHIBATA
a698b5ebb8
[ruby/optparse] Bump up v0.6.0
...
080360ffd4
2024-11-08 04:22:33 +00:00
Nobuyoshi Nakada
5fd3942466
[ruby/optparse] Prefer require_relative
...
bb08cd47a8
2024-09-03 04:43:25 +00:00
fatkodima
a35d324862
[ruby/optparse] Fix parsing array arguments with :into
option
...
19700e96d8
2024-08-05 02:28:12 +00:00
Nobuyoshi Nakada
fc363944b4
[ruby/optparse] bump up to 0.5.0
...
f5018a8b1c
2024-04-15 05:06:46 +00:00
Koichi Sasada
9180e33ca3
show warning for unused block
...
With verbopse mode (-w), the interpreter shows a warning if
a block is passed to a method which does not use the given block.
Warning on:
* the invoked method is written in C
* the invoked method is not `initialize`
* not invoked with `super`
* the first time on the call-site with the invoked method
(`obj.foo{}` will be warned once if `foo` is same method)
[Feature #15554 ]
`Primitive.attr! :use_block` is introduced to declare that primitive
functions (written in C) will use passed block.
For minitest, test needs some tweak, so use
ea9caafc07
for `test-bundled-gems`.
2024-04-15 12:08:07 +09:00
Nobuyoshi Nakada
5d76fe6b2a
[ruby/optparse] Invoke pager for --help
...
77dccce37c
2024-03-01 07:10:08 +00:00
Nobuyoshi Nakada
7da3f8dcd3
[ruby/optparse] [DOC] About return value of OptionParser#new
...
59b9fd7ddc
2024-02-23 12:50:08 +00:00
Nobuyoshi Nakada
41c0fb6991
[ruby/optparse] Add exact:
keyword argument
...
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
...
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
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
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
9d53e74aa4
2024-02-09 19:58:19 +09:00
fatkodima
f7a407cabd
[ruby/optparse] Fix require_exact
to work with options defined as --[no]-something
...
4e346ad337
2024-02-09 03:31:13 +00:00
Nobuyoshi Nakada
50bcaa6286
[ruby/optparse] Escape backslashes
...
b14c2c644d
2024-02-09 03:21:24 +00:00
Nobuyoshi Nakada
e55a57af1e
[ruby/optparse] [DOC] Add missing documents
...
324ff21f04
2023-12-25 21:12:49 +09:00
Hiroshi SHIBATA
3f33bfa1e5
[ruby/optparse] Bump up 0.4.0
...
acbf6e3e12
2023-11-07 01:40:53 +00:00
Nobuyoshi Nakada
dfad14d83f
[ruby/optparse] [DOC] Mark up constant and method names as code
...
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 ]
fb91d97c10
2023-04-04 23:43:58 +00:00
Junichi Ito
cea6951ecf
[ruby/optparse] Add symbolize_names to getopts
...
3e63d878f8
2022-12-26 15:09:21 +09:00
Nobuyoshi Nakada
4c767c1354
[ruby/optparse] bump up to 0.4.0.pre.1
...
73661899ad
2022-12-26 15:09:21 +09:00
Hiroshi SHIBATA
fe7190a8c1
[ruby/optparse] Bump version to 0.3.1
...
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
...
766f567405
2022-12-21 14:09:12 +09:00
Hiroshi SHIBATA
71b4d35526
[ruby/optparse] Bump version to 0.3.0
...
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 )
12529653cd
2022-11-28 14:24:06 +00:00
Nobuyoshi Nakada
e2b15461a7
[ruby/optparse] Use class methods of File
over IO
...
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)
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
...
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 )
...
f2b8318631
2022-07-29 19:10:10 +09:00
Nobuyoshi Nakada
de427c3ce0
[ruby/optparse] Define inspect
and pretty_inspect
...
a3f0ec21b1
2022-04-04 15:05:44 +09:00
Nobuyoshi Nakada
92630e2346
[ruby/optparse] Fix links to the page directory files [Bug #18468 ]
...
dab72c543d
2022-01-12 21:16:02 +09:00
Hiroshi SHIBATA
b8d49d0d01
[ruby/optparse] Bump up optparse version to 0.2.0
...
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.
7f3195b9db
2021-07-28 20:13:39 +09:00
Nobuyoshi Nakada
bf175e7ec2
[ruby/optparse] nodoc private methods
...
f23d750d14
2021-07-28 20:13:38 +09:00