l43_xargs 0.1.3 → 0.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/l43/xargs/parse.rb +6 -2
- data/lib/l43/xargs/version.rb +1 -1
- data/lib/l43/xargs.rb +13 -7
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2af2735e6bc062b94735563e9edeab52d902950ba2cd67aca1660a7d270325bf
|
|
4
|
+
data.tar.gz: 467026bb0cea72da1e5dc86c0f68653096b98c0ce7a30630c4b4ba106b1a5ae7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bdf753e54823c3aa872dc056327a736a00b1e67b3591c1f32bd376cf08a9c9a5e286a67407b7bf299cfcf932eaec465b7e134ef5ca127fbefa08b007aeed1fc1
|
|
7
|
+
data.tar.gz: '09c938ac378149ccdf3c7b9534f72832a35a365f56f5a85998ecbd5c0e06681bca54013b0328fe0764e08bb6925a1e8dd3e90495a62896421fa04161bdd64245'
|
data/lib/l43/xargs/parse.rb
CHANGED
|
@@ -138,8 +138,12 @@ module L43
|
|
|
138
138
|
when LongKwdRgx
|
|
139
139
|
_add_kwd($1.to_sym)
|
|
140
140
|
when PosixShortFlagsRgx
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
if no_posix_short
|
|
142
|
+
_args << argv.first
|
|
143
|
+
else
|
|
144
|
+
$1.grapheme_clusters.each do
|
|
145
|
+
_add_short_flag(it.to_sym, shift: false)
|
|
146
|
+
end
|
|
143
147
|
end
|
|
144
148
|
argv.shift
|
|
145
149
|
when StopParsing
|
data/lib/l43/xargs/version.rb
CHANGED
data/lib/l43/xargs.rb
CHANGED
|
@@ -31,7 +31,12 @@ module L43
|
|
|
31
31
|
ShortKwdRgx = %r{\A(.):\z}
|
|
32
32
|
StopParsing = "::"
|
|
33
33
|
|
|
34
|
-
attr_reader :argv, :autohelp,
|
|
34
|
+
attr_reader :argv, :autohelp,
|
|
35
|
+
:defined_args,
|
|
36
|
+
:last_added,
|
|
37
|
+
:no_posix_short,
|
|
38
|
+
:program_name,
|
|
39
|
+
:usage
|
|
35
40
|
|
|
36
41
|
# extend Core::Forwarder
|
|
37
42
|
def add_desc(*desc, indent: nil, name: nil)
|
|
@@ -125,9 +130,9 @@ module L43
|
|
|
125
130
|
defined_args.print_help(lines, indent:, newline:, program_name:, sections:, section_colors:, usage:, device:)
|
|
126
131
|
end
|
|
127
132
|
|
|
128
|
-
def result
|
|
133
|
+
def result
|
|
129
134
|
raise IllegalMonitorState, "must not call result before calling parse" unless @__full_result__
|
|
130
|
-
@__result__ ||= _result
|
|
135
|
+
@__result__ ||= _result
|
|
131
136
|
end
|
|
132
137
|
|
|
133
138
|
def set_program_name!(program_name)
|
|
@@ -136,16 +141,17 @@ module L43
|
|
|
136
141
|
end
|
|
137
142
|
|
|
138
143
|
def set_usage!(*values)
|
|
139
|
-
@usage = values.flatten
|
|
144
|
+
@usage = values.flatten
|
|
140
145
|
self
|
|
141
146
|
end
|
|
142
147
|
|
|
143
148
|
private
|
|
144
|
-
def initialize(autohelp: false, colorize: :auto, program_name: nil, usage: false, &blk)
|
|
149
|
+
def initialize(autohelp: false, colorize: :auto, no_posix_short: false, program_name: nil, usage: false, &blk)
|
|
145
150
|
raise ArgumentError, "keyword argument colorize is #{colorize.inspect}, not in required set: #{ColorizeValues.inspect}" unless ColorizeValues.member? colorize
|
|
146
151
|
raise ArgumentError, "keyword argument autohelp is #{autohelp.inspect}, but a boolean is required" unless [false, true].member? autohelp
|
|
147
152
|
raise ArgumentError, "blocks are ignored and therefore not supported" if blk
|
|
148
153
|
@colorize = colorize
|
|
154
|
+
@no_posix_short = no_posix_short
|
|
149
155
|
@usage = usage
|
|
150
156
|
|
|
151
157
|
@program_name = program_name
|
|
@@ -168,12 +174,12 @@ module L43
|
|
|
168
174
|
end
|
|
169
175
|
|
|
170
176
|
def checks = @__checks__ ||= []
|
|
171
|
-
|
|
177
|
+
|
|
172
178
|
def _colorize? = @___colorize_p__ ||= @colorize == :always || @colorize == :auto && ENV['NO_COLOR'].nil?
|
|
173
179
|
|
|
174
180
|
def _errors = @__errors__ ||= []
|
|
175
181
|
|
|
176
|
-
def _kwds = @__kwds__ ||= OpenStruct.new
|
|
182
|
+
def _kwds = @__kwds__ ||= OpenStruct.new
|
|
177
183
|
|
|
178
184
|
def _result
|
|
179
185
|
kwds = full_result.kwds.map { |k, v| [k, v.value]}.to_h
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: l43_xargs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Dober
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-09-
|
|
10
|
+
date: 2026-09-07 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: ostruct
|