optparse 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +196 -183
- data/doc/optparse/creates_option.rdoc +2 -2
- data/doc/optparse/option_params.rdoc +3 -3
- data/doc/optparse/tutorial.rdoc +2 -2
- data/lib/optparse/ac.rb +1 -1
- data/lib/optparse/date.rb +1 -1
- data/lib/optparse/kwargs.rb +1 -1
- data/lib/optparse/shellwords.rb +1 -1
- data/lib/optparse/time.rb +1 -1
- data/lib/optparse/uri.rb +1 -1
- data/lib/optparse.rb +94 -11
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 418e5857a7b44f43280185c3b47044dfeeae912cdfbb1732e1d449959d2f7ea6
|
4
|
+
data.tar.gz: 7bc504678e83873db67b7a70cbf70a9795e6d5c8910ad7829ecc0f161eb09e91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5145d4416caf4eb5a64cf415548d56ae7b533089d29b83bd16876fdbde1c644f4b260e1aa3a68010d92107e065f9197c2e0e8691997d80261c5542bbc95ff6ef
|
7
|
+
data.tar.gz: 37cb54b326baa9239ed1366ff2ad465352b8de03a32360f2a4d49e9214a1d6bb01916ebff354787ec378b7d7deb50b2444a1e45eac215fa335b21156ba594818
|
data/ChangeLog
CHANGED
@@ -1,264 +1,277 @@
|
|
1
1
|
-*- coding: utf-8 -*-
|
2
2
|
|
3
|
-
commit
|
3
|
+
commit c80dfb1ebd9e92142de4a0719f7fb91d753c35e5
|
4
4
|
Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
5
|
-
AuthorDate:
|
5
|
+
AuthorDate: 2022-12-05 16:17:01 +0900
|
6
6
|
Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
7
|
-
CommitDate:
|
7
|
+
CommitDate: 2022-12-05 16:17:01 +0900
|
8
8
|
|
9
|
-
Bump
|
9
|
+
Bump version to 0.3.0
|
10
10
|
|
11
|
-
commit
|
12
|
-
Author:
|
13
|
-
AuthorDate:
|
14
|
-
Commit:
|
15
|
-
CommitDate:
|
11
|
+
commit fee86ef7a443e602e951ac67143a890a22e8aa3a
|
12
|
+
Author: Yusuke Endoh <mame@ruby-lang.org>
|
13
|
+
AuthorDate: 2022-11-29 01:14:47 +0900
|
14
|
+
Commit: Yusuke Endoh <mame@ruby-lang.org>
|
15
|
+
CommitDate: 2022-11-29 01:14:47 +0900
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
commit a3d05c1be8efb552b64f3d1af84b8b8dea8e0afb
|
20
|
-
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
21
|
-
AuthorDate: 2021-09-29 11:34:44 +0900
|
22
|
-
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
23
|
-
CommitDate: 2021-09-29 11:34:44 +0900
|
17
|
+
Fix the test failure i ruby/ruby
|
24
18
|
|
25
|
-
|
19
|
+
```
|
20
|
+
$ make test-all TESTS=test/optparse/
|
21
|
+
...
|
26
22
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
23
|
+
[148/178] TestOptionParserDidYouMean#test_raise_unknown = 0.00 s
|
24
|
+
1) Failure:
|
25
|
+
TestOptionParserDidYouMean#test_raise_unknown [/home/mame/work/ruby/test/optparse/test_optparse.rb:106]:
|
26
|
+
<["--bar"]> expected but was
|
27
|
+
<[]>.
|
28
|
+
```
|
32
29
|
|
33
|
-
|
30
|
+
In the old test/unit (bundled in ruby/ruby), when a test class inherits from
|
31
|
+
another test class, the child class runs all the tests defined in the parent
|
32
|
+
class.
|
33
|
+
However, it looks like the new test/unit does not do so. This is because the
|
34
|
+
test failure does not occur in ruby/optparse.
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
AuthorDate: 2021-04-22 14:22:11 -0500
|
38
|
-
Commit: Burdette Lamar <BurdetteLamar@Yahoo.com>
|
39
|
-
CommitDate: 2021-04-22 14:22:11 -0500
|
36
|
+
As a tentative solution, this changes the option names in TestOptionParser to
|
37
|
+
avoid the name conflict with TestOptionParserDidYouMean.
|
40
38
|
|
41
|
-
|
39
|
+
commit 12529653cd35ed38cb0a00d22ec0fe6e0907ce89
|
40
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
41
|
+
AuthorDate: 2022-10-30 00:36:19 +0900
|
42
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
43
|
+
CommitDate: 2022-11-28 23:23:54 +0900
|
42
44
|
|
43
|
-
|
44
|
-
Author: Olle Jonsson <olle.jonsson@gmail.com>
|
45
|
-
AuthorDate: 2021-04-23 13:04:25 +0200
|
46
|
-
Commit: GitHub <noreply@github.com>
|
47
|
-
CommitDate: 2021-04-23 06:04:25 -0500
|
45
|
+
Add `raise_unknown` flag (#38)
|
48
46
|
|
49
|
-
|
47
|
+
commit ab5073e4d8928814a1e667bb93164d6998bf2558
|
48
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
49
|
+
AuthorDate: 2022-11-21 18:28:33 +0900
|
50
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
51
|
+
CommitDate: 2022-11-21 18:30:01 +0900
|
50
52
|
|
51
|
-
|
52
|
-
Author: Burdette Lamar <BurdetteLamar@Yahoo.com>
|
53
|
-
AuthorDate: 2021-04-22 08:48:23 -0500
|
54
|
-
Commit: GitHub <noreply@github.com>
|
55
|
-
CommitDate: 2021-04-22 08:48:23 -0500
|
53
|
+
Use class methods of `File` over `IO`
|
56
54
|
|
57
|
-
|
55
|
+
commit 51f7e060ee6e2ccab6b052e7fb14532bc3485ce2
|
56
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
57
|
+
AuthorDate: 2022-10-29 22:25:42 +0900
|
58
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
59
|
+
CommitDate: 2022-10-29 22:46:59 +0900
|
58
60
|
|
59
|
-
|
60
|
-
- Removes section "Terminators" from option_params.rdoc. (Terminator '--' is not an option parameter.)
|
61
|
+
Add tests for `load(into:)`
|
61
62
|
|
62
|
-
commit
|
63
|
-
Author:
|
64
|
-
AuthorDate:
|
63
|
+
commit 2ea626fcff72b68b5ae6e1381c28f5db94de7e94
|
64
|
+
Author: Whyme Lyu <5longluna@gmail.com>
|
65
|
+
AuthorDate: 2022-10-29 21:46:23 +0800
|
65
66
|
Commit: GitHub <noreply@github.com>
|
66
|
-
CommitDate:
|
67
|
+
CommitDate: 2022-10-29 22:46:23 +0900
|
68
|
+
|
69
|
+
#load() into hash (#42)
|
67
70
|
|
68
|
-
|
71
|
+
OptionParser#load learns .load(into: Hash)
|
69
72
|
|
70
|
-
-
|
71
|
-
- Added sections "Top List and Base List" and "Methods for Defining Options" (on, define, etc.).
|
72
|
-
- Linked from class OptionParser doc to the tutorial.
|
73
|
+
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
73
74
|
|
74
|
-
commit
|
75
|
+
commit fb34a1d3a36aa33a5d2a02d511fbd705887505b0
|
75
76
|
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
76
|
-
AuthorDate:
|
77
|
+
AuthorDate: 2022-10-29 22:23:14 +0900
|
77
78
|
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
78
|
-
CommitDate:
|
79
|
+
CommitDate: 2022-10-29 22:40:11 +0900
|
79
80
|
|
80
|
-
|
81
|
+
Add tests for `OptionParser#load`
|
81
82
|
|
82
|
-
commit
|
83
|
-
Author:
|
84
|
-
AuthorDate:
|
83
|
+
commit 078638ee6da875680ebcfd06efa50bb573fd1af2
|
84
|
+
Author: Maciek Rząsa <maciejrzasa@gmail.com>
|
85
|
+
AuthorDate: 2022-10-08 12:30:12 +0200
|
85
86
|
Commit: GitHub <noreply@github.com>
|
86
|
-
CommitDate:
|
87
|
-
|
88
|
-
More on tutorial (#22)
|
87
|
+
CommitDate: 2022-10-08 19:30:12 +0900
|
89
88
|
|
90
|
-
|
91
|
-
Adds entire Argument Values section to tutorial.rdoc.
|
89
|
+
Don't treat empty string as an option description
|
92
90
|
|
93
|
-
commit
|
94
|
-
Author:
|
95
|
-
AuthorDate:
|
96
|
-
Commit:
|
97
|
-
CommitDate:
|
91
|
+
commit 3bcca8a81574aaef19a6ba09f91fc1e318aadfa4
|
92
|
+
Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
93
|
+
AuthorDate: 2022-06-17 18:35:47 +0900
|
94
|
+
Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
95
|
+
CommitDate: 2022-06-17 18:41:16 +0900
|
98
96
|
|
99
|
-
|
97
|
+
Update Ruby versions on GHA with ci_versions/all.json
|
100
98
|
|
101
|
-
commit
|
102
|
-
Author:
|
103
|
-
AuthorDate:
|
99
|
+
commit f2b8318631d3d265131a0b281ee730025eda9027
|
100
|
+
Author: konsolebox <konsolebox@gmail.com>
|
101
|
+
AuthorDate: 2022-06-09 19:43:24 +0800
|
104
102
|
Commit: GitHub <noreply@github.com>
|
105
|
-
CommitDate:
|
103
|
+
CommitDate: 2022-06-09 20:43:24 +0900
|
106
104
|
|
107
|
-
|
105
|
+
Also accept '-' as an optional argument (#35)
|
108
106
|
|
109
|
-
commit
|
110
|
-
Author:
|
111
|
-
AuthorDate:
|
112
|
-
Commit:
|
113
|
-
CommitDate:
|
107
|
+
commit e70e689deddb6c1d72e2073a5c4723b3fdfff68c
|
108
|
+
Author: ydah <13041216+ydah@users.noreply.github.com>
|
109
|
+
AuthorDate: 2022-05-21 06:24:41 +0900
|
110
|
+
Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
111
|
+
CommitDate: 2022-05-21 08:47:36 +0900
|
114
112
|
|
115
|
-
|
113
|
+
Fix typo in documentation
|
116
114
|
|
117
|
-
|
118
|
-
|
119
|
-
AuthorDate: 2021-04-12 00:38:40 +0900
|
120
|
-
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
121
|
-
CommitDate: 2021-04-12 00:38:40 +0900
|
115
|
+
- "hypnen" -> "hyphen"
|
116
|
+
- "hadler" -> "handler"
|
122
117
|
|
123
|
-
|
118
|
+
commit 4b47d9c24b3b143bc661c3ef5d0de9f71882b4ce
|
119
|
+
Author: Jeremy Evans <code@jeremyevans.net>
|
120
|
+
AuthorDate: 2022-04-22 13:01:43 -0700
|
121
|
+
Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
122
|
+
CommitDate: 2022-05-02 20:12:12 +0900
|
124
123
|
|
125
|
-
|
126
|
-
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
127
|
-
AuthorDate: 2021-04-11 09:03:07 +0900
|
128
|
-
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
129
|
-
CommitDate: 2021-04-11 09:03:07 +0900
|
124
|
+
Avoid defining the same test class in multiple files
|
130
125
|
|
131
|
-
|
126
|
+
Should fix issues with parallel testing sometimes not running all
|
127
|
+
tests.
|
132
128
|
|
133
|
-
|
134
|
-
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
135
|
-
AuthorDate: 2021-04-11 08:49:30 +0900
|
136
|
-
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
137
|
-
CommitDate: 2021-04-11 08:51:44 +0900
|
129
|
+
This should be viewed skipping whitespace changes.
|
138
130
|
|
139
|
-
|
131
|
+
Fixes [Bug #18731]
|
140
132
|
|
141
|
-
commit
|
142
|
-
Author:
|
143
|
-
AuthorDate:
|
144
|
-
Commit:
|
145
|
-
CommitDate:
|
146
|
-
|
147
|
-
Added `rdoc` task
|
148
|
-
|
149
|
-
commit 4ff48f24c9b44740dd6c63bc5005db8959c21f80
|
150
|
-
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
151
|
-
AuthorDate: 2021-04-09 23:20:03 +0900
|
152
|
-
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
153
|
-
CommitDate: 2021-04-11 08:10:41 +0900
|
133
|
+
commit 2bea3b38c354c3a49b5705f9f560eef522b4b1e2
|
134
|
+
Author: Peter Zhu <peter@peterzhu.ca>
|
135
|
+
AuthorDate: 2022-04-14 11:15:57 -0400
|
136
|
+
Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
137
|
+
CommitDate: 2022-04-15 14:21:13 +0900
|
154
138
|
|
155
|
-
|
139
|
+
Fix broken links in docs
|
156
140
|
|
157
|
-
commit
|
158
|
-
Author:
|
159
|
-
AuthorDate:
|
160
|
-
Commit:
|
161
|
-
CommitDate:
|
141
|
+
commit 3653d5b909d876d3322546a4c2157ea5a94df1b9
|
142
|
+
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
143
|
+
AuthorDate: 2022-04-11 03:21:22 +0000
|
144
|
+
Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
145
|
+
CommitDate: 2022-04-11 12:39:39 +0900
|
162
146
|
|
163
|
-
|
147
|
+
Bump actions/upload-artifact from 2 to 3
|
164
148
|
|
165
|
-
-
|
166
|
-
-
|
167
|
-
|
168
|
-
- Collect options.
|
169
|
-
- Check for missing options.
|
170
|
-
- Provide option defaults.
|
149
|
+
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
|
150
|
+
- [Release notes](https://github.com/actions/upload-artifact/releases)
|
151
|
+
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)
|
171
152
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
153
|
+
---
|
154
|
+
updated-dependencies:
|
155
|
+
- dependency-name: actions/upload-artifact
|
156
|
+
dependency-type: direct:production
|
157
|
+
update-type: version-update:semver-major
|
158
|
+
...
|
177
159
|
|
178
|
-
|
160
|
+
Signed-off-by: dependabot[bot] <support@github.com>
|
179
161
|
|
180
|
-
|
162
|
+
commit a3f0ec21b19bd26111f1025fd8434e55beef309d
|
163
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
164
|
+
AuthorDate: 2022-04-04 15:05:15 +0900
|
165
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
166
|
+
CommitDate: 2022-04-04 15:05:15 +0900
|
181
167
|
|
182
|
-
|
168
|
+
Define `inspect` and `pretty_inspect`
|
183
169
|
|
184
|
-
|
170
|
+
commit 482a42668e7228485b3274cfb0523af87ab44e56
|
171
|
+
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
172
|
+
AuthorDate: 2022-03-25 16:56:25 +0900
|
173
|
+
Commit: GitHub <noreply@github.com>
|
174
|
+
CommitDate: 2022-03-25 16:56:25 +0900
|
185
175
|
|
186
|
-
|
176
|
+
Bump actions/checkout from 2 to 3 (#31)
|
187
177
|
|
188
|
-
|
178
|
+
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
|
179
|
+
- [Release notes](https://github.com/actions/checkout/releases)
|
180
|
+
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
|
181
|
+
- [Commits](https://github.com/actions/checkout/compare/v2...v3)
|
189
182
|
|
190
|
-
|
183
|
+
---
|
184
|
+
updated-dependencies:
|
185
|
+
- dependency-name: actions/checkout
|
186
|
+
dependency-type: direct:production
|
187
|
+
update-type: version-update:semver-major
|
188
|
+
...
|
191
189
|
|
192
|
-
|
190
|
+
Signed-off-by: dependabot[bot] <support@github.com>
|
193
191
|
|
194
|
-
|
192
|
+
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
195
193
|
|
196
|
-
commit
|
197
|
-
Author:
|
198
|
-
AuthorDate:
|
194
|
+
commit 5bc8b13b8806bac75f8aa0adeaa75a6631b992ec
|
195
|
+
Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
196
|
+
AuthorDate: 2022-03-25 16:49:09 +0900
|
199
197
|
Commit: GitHub <noreply@github.com>
|
200
|
-
CommitDate:
|
198
|
+
CommitDate: 2022-03-25 16:49:09 +0900
|
201
199
|
|
202
|
-
|
200
|
+
Added dependabot (#30)
|
203
201
|
|
204
|
-
commit
|
205
|
-
Author:
|
206
|
-
AuthorDate:
|
207
|
-
Commit:
|
208
|
-
CommitDate:
|
202
|
+
commit 9e29d86c12819dc383e042cc0059224299a8fcd8
|
203
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
204
|
+
AuthorDate: 2022-01-12 20:58:54 +0900
|
205
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
206
|
+
CommitDate: 2022-01-12 20:58:54 +0900
|
209
207
|
|
210
|
-
|
208
|
+
Fix for ruby 3.0 or earlier
|
211
209
|
|
212
|
-
|
210
|
+
commit 0ac99576964657f7f44dadcca4c2546594076f88
|
211
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
212
|
+
AuthorDate: 2022-01-12 19:37:33 +0900
|
213
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
214
|
+
CommitDate: 2022-01-12 19:37:33 +0900
|
213
215
|
|
214
|
-
|
216
|
+
DidYouMean::PlainFormatter is deprecated
|
215
217
|
|
216
|
-
commit
|
217
|
-
Author:
|
218
|
-
AuthorDate:
|
218
|
+
commit dab72c543db6c0c0f89a470006ae71390adf0c50
|
219
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
220
|
+
AuthorDate: 2022-01-12 18:22:11 +0900
|
219
221
|
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
220
|
-
CommitDate:
|
222
|
+
CommitDate: 2022-01-12 18:22:11 +0900
|
221
223
|
|
222
|
-
|
224
|
+
Fix links to the page directory files
|
223
225
|
|
224
|
-
|
225
|
-
Author: Burdette Lamar <BurdetteLamar@Yahoo.com>
|
226
|
-
AuthorDate: 2021-04-07 09:01:52 -0500
|
227
|
-
Commit: GitHub <noreply@github.com>
|
228
|
-
CommitDate: 2021-04-07 16:01:52 +0200
|
226
|
+
https://bugs.ruby-lang.org/issues/18468
|
229
227
|
|
230
|
-
|
228
|
+
commit d182cd60b58eb6bc537f23b0309cde187309056b
|
229
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
230
|
+
AuthorDate: 2022-01-12 18:17:22 +0900
|
231
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
232
|
+
CommitDate: 2022-01-12 18:19:40 +0900
|
231
233
|
|
232
|
-
|
233
|
-
Author: Burdette Lamar <BurdetteLamar@Yahoo.com>
|
234
|
-
AuthorDate: 2021-04-06 13:55:21 -0500
|
235
|
-
Commit: GitHub <noreply@github.com>
|
236
|
-
CommitDate: 2021-04-06 13:55:21 -0500
|
234
|
+
Add rdoc options
|
237
235
|
|
238
|
-
|
236
|
+
Specify the main page and the page directory. Also in Rakefile,
|
237
|
+
extract and use the same options from the gemspec file.
|
239
238
|
|
240
|
-
|
239
|
+
commit ed283559d492e917f1c28b0ece9ea9c3e1327016
|
240
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
241
|
+
AuthorDate: 2022-01-12 18:16:30 +0900
|
242
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
243
|
+
CommitDate: 2022-01-12 18:19:39 +0900
|
241
244
|
|
242
|
-
|
245
|
+
Add .document files
|
243
246
|
|
244
|
-
|
247
|
+
commit e4f26821283dbf7d7dba8973e332641cff3f119f
|
248
|
+
Author: David Rodríguez <deivid.rodriguez@riseup.net>
|
249
|
+
AuthorDate: 2022-01-04 08:32:45 +0100
|
250
|
+
Commit: GitHub <noreply@github.com>
|
251
|
+
CommitDate: 2022-01-04 16:32:45 +0900
|
245
252
|
|
246
|
-
|
253
|
+
Use `require_relative` for internal requires (#28)
|
247
254
|
|
248
|
-
commit
|
249
|
-
Author:
|
250
|
-
AuthorDate: 2021-
|
255
|
+
commit faf8e5c8fba85ae2dda8d9d882de4c7016b31ec5
|
256
|
+
Author: Takashi Kokubun <takashikkbn@gmail.com>
|
257
|
+
AuthorDate: 2021-12-14 20:49:32 -0800
|
251
258
|
Commit: GitHub <noreply@github.com>
|
252
|
-
CommitDate: 2021-
|
259
|
+
CommitDate: 2021-12-14 20:49:32 -0800
|
253
260
|
|
254
|
-
|
261
|
+
s/RubyVM::JIT/RubyVM::MJIT/g (#29)
|
255
262
|
|
256
|
-
|
263
|
+
commit 61df7522f80a04ce40fc7dea655d4b016f224c83
|
264
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
265
|
+
AuthorDate: 2021-11-03 19:52:14 +0900
|
266
|
+
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
267
|
+
CommitDate: 2021-11-03 19:52:14 +0900
|
268
|
+
|
269
|
+
Remove the test for deprecated DidYouMean::VerboseFormatter
|
257
270
|
|
258
|
-
commit
|
259
|
-
Author:
|
260
|
-
AuthorDate: 2021-03
|
271
|
+
commit 0aa18752cfcc2e9bd47afe57348ddc0fc966c981
|
272
|
+
Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
273
|
+
AuthorDate: 2021-11-03 18:34:13 +0900
|
261
274
|
Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
262
|
-
CommitDate: 2021-03
|
275
|
+
CommitDate: 2021-11-03 18:34:13 +0900
|
263
276
|
|
264
|
-
|
277
|
+
Fix typo [ci skip]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Creates an option from the given parameters +params+.
|
2
|
-
See {Parameters for New Options}[
|
2
|
+
See {Parameters for New Options}[optparse/option_params.rdoc].
|
3
3
|
|
4
4
|
The block, if given, is the handler for the created option.
|
5
5
|
When the option is encountered during command-line parsing,
|
6
6
|
the block is called with the argument given for the option, if any.
|
7
|
-
See {Option Handlers}[
|
7
|
+
See {Option Handlers}[optparse/option_params.rdoc#label-Option+Handlers].
|
@@ -410,7 +410,7 @@ from the default \String to an instance of another class.
|
|
410
410
|
There are a number of built-in converters.
|
411
411
|
You can also define custom converters.
|
412
412
|
|
413
|
-
See {Argument Converters}[./
|
413
|
+
See {Argument Converters}[./argument_converters.rdoc].
|
414
414
|
|
415
415
|
=== Descriptions
|
416
416
|
|
@@ -418,7 +418,7 @@ A description parameter is any string parameter
|
|
418
418
|
that is not recognized as an
|
419
419
|
{option name}[#label-Option+Names] or a
|
420
420
|
{terminator}[#label-Terminators];
|
421
|
-
in other words, it does not begin with a
|
421
|
+
in other words, it does not begin with a hyphen.
|
422
422
|
|
423
423
|
You may give any number of description parameters;
|
424
424
|
each becomes a line in the text generated by option <tt>--help</tt>.
|
@@ -453,7 +453,7 @@ when the option is encountered. The handler may be:
|
|
453
453
|
|
454
454
|
==== Handler Blocks
|
455
455
|
|
456
|
-
An option
|
456
|
+
An option handler may be a block.
|
457
457
|
|
458
458
|
File +block.rb+ defines an option that has a handler block.
|
459
459
|
|
data/doc/optparse/tutorial.rdoc
CHANGED
@@ -541,7 +541,7 @@ Executions:
|
|
541
541
|
[#<Date: 2001-02-03 ((2451944j,0s,0n),+0s,2299161j)>, Date]
|
542
542
|
|
543
543
|
You can also define custom converters.
|
544
|
-
See {Argument Converters}[./
|
544
|
+
See {Argument Converters}[./argument_converters.rdoc]
|
545
545
|
for both built-in and custom converters.
|
546
546
|
|
547
547
|
=== Help
|
@@ -657,7 +657,7 @@ Though you may never need to call it directly,
|
|
657
657
|
here's the core method for defining an option:
|
658
658
|
|
659
659
|
- \Method \OptionParser#make_switch accepts an array of parameters and a block.
|
660
|
-
See {Parameters for New Options}[
|
660
|
+
See {Parameters for New Options}[optparse/option_params.rdoc].
|
661
661
|
This method is unlike others here in that it:
|
662
662
|
- Accepts an <em>array of parameters</em>;
|
663
663
|
others accept a <em>sequence of parameter arguments</em>.
|
data/lib/optparse/ac.rb
CHANGED
data/lib/optparse/date.rb
CHANGED
data/lib/optparse/kwargs.rb
CHANGED
data/lib/optparse/shellwords.rb
CHANGED
data/lib/optparse/time.rb
CHANGED
data/lib/optparse/uri.rb
CHANGED
data/lib/optparse.rb
CHANGED
@@ -50,7 +50,7 @@
|
|
50
50
|
#
|
51
51
|
# === New to \OptionParser?
|
52
52
|
#
|
53
|
-
# See the {Tutorial}[
|
53
|
+
# See the {Tutorial}[optparse/tutorial.rdoc].
|
54
54
|
#
|
55
55
|
# === Introduction
|
56
56
|
#
|
@@ -420,12 +420,12 @@
|
|
420
420
|
# === Further documentation
|
421
421
|
#
|
422
422
|
# The above examples, along with the accompanying
|
423
|
-
# {Tutorial}[
|
423
|
+
# {Tutorial}[optparse/tutorial.rdoc],
|
424
424
|
# should be enough to learn how to use this class.
|
425
425
|
# If you have any questions, file a ticket at http://bugs.ruby-lang.org.
|
426
426
|
#
|
427
427
|
class OptionParser
|
428
|
-
OptionParser::Version = "0.
|
428
|
+
OptionParser::Version = "0.3.0"
|
429
429
|
|
430
430
|
# :stopdoc:
|
431
431
|
NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
|
@@ -674,6 +674,29 @@ class OptionParser
|
|
674
674
|
end
|
675
675
|
end
|
676
676
|
|
677
|
+
def pretty_print_contents(q) # :nodoc:
|
678
|
+
if @block
|
679
|
+
q.text ":" + @block.source_location.join(":") + ":"
|
680
|
+
first = false
|
681
|
+
else
|
682
|
+
first = true
|
683
|
+
end
|
684
|
+
[@short, @long].each do |list|
|
685
|
+
list.each do |opt|
|
686
|
+
if first
|
687
|
+
q.text ":"
|
688
|
+
first = false
|
689
|
+
end
|
690
|
+
q.breakable
|
691
|
+
q.text opt
|
692
|
+
end
|
693
|
+
end
|
694
|
+
end
|
695
|
+
|
696
|
+
def pretty_print(q) # :nodoc:
|
697
|
+
q.object_group(self) {pretty_print_contents(q)}
|
698
|
+
end
|
699
|
+
|
677
700
|
#
|
678
701
|
# Switch that takes no arguments.
|
679
702
|
#
|
@@ -693,6 +716,10 @@ class OptionParser
|
|
693
716
|
def self.pattern
|
694
717
|
Object
|
695
718
|
end
|
719
|
+
|
720
|
+
def pretty_head # :nodoc:
|
721
|
+
"NoArgument"
|
722
|
+
end
|
696
723
|
end
|
697
724
|
|
698
725
|
#
|
@@ -710,6 +737,10 @@ class OptionParser
|
|
710
737
|
end
|
711
738
|
conv_arg(*parse_arg(arg, &method(:raise)))
|
712
739
|
end
|
740
|
+
|
741
|
+
def pretty_head # :nodoc:
|
742
|
+
"Required"
|
743
|
+
end
|
713
744
|
end
|
714
745
|
|
715
746
|
#
|
@@ -727,18 +758,22 @@ class OptionParser
|
|
727
758
|
conv_arg(arg)
|
728
759
|
end
|
729
760
|
end
|
761
|
+
|
762
|
+
def pretty_head # :nodoc:
|
763
|
+
"Optional"
|
764
|
+
end
|
730
765
|
end
|
731
766
|
|
732
767
|
#
|
733
|
-
# Switch that takes an argument, which does not begin with '-'.
|
768
|
+
# Switch that takes an argument, which does not begin with '-' or is '-'.
|
734
769
|
#
|
735
770
|
class PlacedArgument < self
|
736
771
|
|
737
772
|
#
|
738
|
-
# Returns nil if argument is not present or begins with '-'.
|
773
|
+
# Returns nil if argument is not present or begins with '-' and is not '-'.
|
739
774
|
#
|
740
775
|
def parse(arg, argv, &error)
|
741
|
-
if !(val = arg) and (argv.empty? or /\A
|
776
|
+
if !(val = arg) and (argv.empty? or /\A-./ =~ (val = argv[0]))
|
742
777
|
return nil, block, nil
|
743
778
|
end
|
744
779
|
opt = (val = parse_arg(val, &error))[1]
|
@@ -750,6 +785,10 @@ class OptionParser
|
|
750
785
|
end
|
751
786
|
val
|
752
787
|
end
|
788
|
+
|
789
|
+
def pretty_head # :nodoc:
|
790
|
+
"Placed"
|
791
|
+
end
|
753
792
|
end
|
754
793
|
end
|
755
794
|
|
@@ -781,6 +820,17 @@ class OptionParser
|
|
781
820
|
@list = []
|
782
821
|
end
|
783
822
|
|
823
|
+
def pretty_print(q) # :nodoc:
|
824
|
+
q.group(1, "(", ")") do
|
825
|
+
@list.each do |sw|
|
826
|
+
next unless Switch === sw
|
827
|
+
q.group(1, "(" + sw.pretty_head, ")") do
|
828
|
+
sw.pretty_print_contents(q)
|
829
|
+
end
|
830
|
+
end
|
831
|
+
end
|
832
|
+
end
|
833
|
+
|
784
834
|
#
|
785
835
|
# See OptionParser.accept.
|
786
836
|
#
|
@@ -1098,6 +1148,7 @@ XXX
|
|
1098
1148
|
@summary_indent = indent
|
1099
1149
|
@default_argv = ARGV
|
1100
1150
|
@require_exact = false
|
1151
|
+
@raise_unknown = true
|
1101
1152
|
add_officious
|
1102
1153
|
yield self if block_given?
|
1103
1154
|
end
|
@@ -1175,6 +1226,9 @@ XXX
|
|
1175
1226
|
# abbreviated long option as short option).
|
1176
1227
|
attr_accessor :require_exact
|
1177
1228
|
|
1229
|
+
# Whether to raise at unknown option.
|
1230
|
+
attr_accessor :raise_unknown
|
1231
|
+
|
1178
1232
|
#
|
1179
1233
|
# Heading banner preceding summary.
|
1180
1234
|
#
|
@@ -1293,6 +1347,29 @@ XXX
|
|
1293
1347
|
def help; summarize("#{banner}".sub(/\n?\z/, "\n")) end
|
1294
1348
|
alias to_s help
|
1295
1349
|
|
1350
|
+
def pretty_print(q) # :nodoc:
|
1351
|
+
q.object_group(self) do
|
1352
|
+
first = true
|
1353
|
+
if @stack.size > 2
|
1354
|
+
@stack.each_with_index do |s, i|
|
1355
|
+
next if i < 2
|
1356
|
+
next if s.list.empty?
|
1357
|
+
if first
|
1358
|
+
first = false
|
1359
|
+
q.text ":"
|
1360
|
+
end
|
1361
|
+
q.breakable
|
1362
|
+
s.pretty_print(q)
|
1363
|
+
end
|
1364
|
+
end
|
1365
|
+
end
|
1366
|
+
end
|
1367
|
+
|
1368
|
+
def inspect # :nodoc:
|
1369
|
+
require 'pp'
|
1370
|
+
pretty_print_inspect
|
1371
|
+
end
|
1372
|
+
|
1296
1373
|
#
|
1297
1374
|
# Returns option summary list.
|
1298
1375
|
#
|
@@ -1429,7 +1506,7 @@ XXX
|
|
1429
1506
|
style = notwice(default_style.guess(arg = o), style, 'style')
|
1430
1507
|
default_pattern, conv = search(:atype, Object) unless default_pattern
|
1431
1508
|
else
|
1432
|
-
desc.push(o)
|
1509
|
+
desc.push(o) if o && !o.empty?
|
1433
1510
|
end
|
1434
1511
|
end
|
1435
1512
|
|
@@ -1566,9 +1643,11 @@ XXX
|
|
1566
1643
|
begin
|
1567
1644
|
sw, = complete(:long, opt, true)
|
1568
1645
|
if require_exact && !sw.long.include?(arg)
|
1646
|
+
throw :terminate, arg unless raise_unknown
|
1569
1647
|
raise InvalidOption, arg
|
1570
1648
|
end
|
1571
1649
|
rescue ParseError
|
1650
|
+
throw :terminate, arg unless raise_unknown
|
1572
1651
|
raise $!.set_option(arg, true)
|
1573
1652
|
end
|
1574
1653
|
begin
|
@@ -1600,6 +1679,7 @@ XXX
|
|
1600
1679
|
end
|
1601
1680
|
end
|
1602
1681
|
rescue ParseError
|
1682
|
+
throw :terminate, arg unless raise_unknown
|
1603
1683
|
raise $!.set_option(arg, true)
|
1604
1684
|
end
|
1605
1685
|
begin
|
@@ -1830,10 +1910,13 @@ XXX
|
|
1830
1910
|
# directory ~/.options, then the basename with '.options' suffix
|
1831
1911
|
# under XDG and Haiku standard places.
|
1832
1912
|
#
|
1833
|
-
|
1913
|
+
# The optional +into+ keyword argument works exactly like that accepted in
|
1914
|
+
# method #parse.
|
1915
|
+
#
|
1916
|
+
def load(filename = nil, into: nil)
|
1834
1917
|
unless filename
|
1835
1918
|
basename = File.basename($0, '.*')
|
1836
|
-
return true if load(File.expand_path(basename, '~/.options')) rescue nil
|
1919
|
+
return true if load(File.expand_path(basename, '~/.options'), into: into) rescue nil
|
1837
1920
|
basename << ".options"
|
1838
1921
|
return [
|
1839
1922
|
# XDG
|
@@ -1845,11 +1928,11 @@ XXX
|
|
1845
1928
|
'~/config/settings',
|
1846
1929
|
].any? {|dir|
|
1847
1930
|
next if !dir or dir.empty?
|
1848
|
-
load(File.expand_path(basename, dir)) rescue nil
|
1931
|
+
load(File.expand_path(basename, dir), into: into) rescue nil
|
1849
1932
|
}
|
1850
1933
|
end
|
1851
1934
|
begin
|
1852
|
-
parse(*
|
1935
|
+
parse(*File.readlines(filename, chomp: true), into: into)
|
1853
1936
|
true
|
1854
1937
|
rescue Errno::ENOENT, Errno::ENOTDIR
|
1855
1938
|
false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: optparse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nobu Nakada
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: OptionParser is a class for command-line option analysis.
|
14
14
|
email:
|
@@ -98,7 +98,10 @@ metadata:
|
|
98
98
|
homepage_uri: https://github.com/ruby/optparse
|
99
99
|
source_code_uri: https://github.com/ruby/optparse
|
100
100
|
post_install_message:
|
101
|
-
rdoc_options:
|
101
|
+
rdoc_options:
|
102
|
+
- "--main=README.md"
|
103
|
+
- "--op=rdoc"
|
104
|
+
- "--page-dir=doc"
|
102
105
|
require_paths:
|
103
106
|
- lib
|
104
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -112,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
115
|
- !ruby/object:Gem::Version
|
113
116
|
version: '0'
|
114
117
|
requirements: []
|
115
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.4.0.dev
|
116
119
|
signing_key:
|
117
120
|
specification_version: 4
|
118
121
|
summary: OptionParser is a class for command-line option analysis.
|