shellopts 2.1.3 → 2.1.4
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/lib/shellopts/args.rb +2 -0
- data/lib/shellopts/version.rb +1 -1
- data/lib/shellopts.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e35f8f74b401892334c494a767678b724049a9e77c275884591718d7903bfdf
|
4
|
+
data.tar.gz: bec330c7546466bc6e25f74fd2d3e9ae94247db5e048515a5b342cbf9cee31a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49f17500a669a195ba1ccd75b14f9b8417e7640c2ae54dd704a5a0995e01a644fb860a93f0d645829e3d34859955eafd58b96528226b79c57326ff8692976114
|
7
|
+
data.tar.gz: b6e29046a96b36c68a088fa43f2ee2f25ad1c0fd9da5b5741035f7cae1be9030c731e1a3491fb47b2a51730e385388e8bc373bfd7986413b954ac3be929ac22c
|
data/lib/shellopts/args.rb
CHANGED
@@ -26,6 +26,7 @@ module ShellOpts
|
|
26
26
|
# #extract raise a ShellOpts::Error exception if there's is not enough
|
27
27
|
# elements in the array to satisfy the request
|
28
28
|
#
|
29
|
+
# TODO: Better handling of ranges. Allow: 2..-1, -2..-4, etc.
|
29
30
|
def extract(count_or_range, message = nil)
|
30
31
|
case count_or_range
|
31
32
|
when Range
|
@@ -52,6 +53,7 @@ module ShellOpts
|
|
52
53
|
# #expect raise a ShellOpts::Error exception if the array is not emptied
|
53
54
|
# by the operation
|
54
55
|
#
|
56
|
+
# TODO: Better handling of ranges. Allow: 2..-1, -2..-4, etc.
|
55
57
|
def expect(count_or_range, message = nil)
|
56
58
|
case count_or_range
|
57
59
|
when Range
|
data/lib/shellopts/version.rb
CHANGED
data/lib/shellopts.rb
CHANGED
@@ -212,15 +212,15 @@ module ShellOpts
|
|
212
212
|
@argv = argv.dup
|
213
213
|
@program, @args = Interpreter.interpret(grammar, argv, float: float, exception: exception)
|
214
214
|
|
215
|
-
# Process standard options
|
216
|
-
if @program.__send__(:"#{@help_option.ident}?")
|
215
|
+
# Process standard options that may have been renamed or be deactivated
|
216
|
+
if @help && @program.__send__(:"#{@help_option.ident}?")
|
217
217
|
if @program[:help].name =~ /^--/
|
218
218
|
ShellOpts.help
|
219
219
|
else
|
220
220
|
ShellOpts.brief
|
221
221
|
end
|
222
222
|
exit
|
223
|
-
elsif @program.__send__(:"#{@version_option.ident}?")
|
223
|
+
elsif @version && @program.__send__(:"#{@version_option.ident}?")
|
224
224
|
puts version_number
|
225
225
|
exit
|
226
226
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shellopts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: forward_to
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.3.
|
176
|
+
rubygems_version: 3.3.18
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Parse command line options and arguments
|