benry-cmdopt 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -0
- data/README.md +1 -1
- data/benry-cmdopt.gemspec +1 -1
- data/doc/benry-cmdopt.html +1 -1
- data/lib/benry/cmdopt.rb +9 -2
- data/test/cmdopt_test.rb +13 -0
- 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: 9308d0182f3f4a17d45f3b7a1f212a4f5f2112f4084d725b2de05271a908bb1d
|
4
|
+
data.tar.gz: f9b8e9066b9857d2693382f03bcbeacdd040695287d426d8ef8c28cf242f1cd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e231075a8a9fdd99a0379390ebc1fae07c812f8229d1689e0b7f04b91d5c0c596122835dde000c3ba609681898c3048fa51d08232cd33d4b9df0bacbc22036c6
|
7
|
+
data.tar.gz: bcabe45f475efd7c95e989c9f7f2c9b61c65396b6373cbb0a68427ce10798a942c4af3cfd8ae66a34928c710b2cac24388d8848a6a1271ca40d3e9458a217898
|
data/CHANGES.md
CHANGED
@@ -2,6 +2,13 @@ CHANGES
|
|
2
2
|
=======
|
3
3
|
|
4
4
|
|
5
|
+
Release 2.2.0 (2023-10-28)
|
6
|
+
--------------------------
|
7
|
+
|
8
|
+
* [enhance] Define `SchemaItem#add_item()` which adds option item into the schema. This is for Benry-CmdApp framework.
|
9
|
+
* [change] (EXPERIMENTAL) Make `desc`, `detail`, `hidden`, `important`, `tag` attrubtes of `SchemaItem` object to be writable. This is for Benry-CmdApp framework.
|
10
|
+
|
11
|
+
|
5
12
|
Release 2.1.0 (2023-10-15)
|
6
13
|
--------------------------
|
7
14
|
|
data/README.md
CHANGED
data/benry-cmdopt.gemspec
CHANGED
data/doc/benry-cmdopt.html
CHANGED
data/lib/benry/cmdopt.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
###
|
5
|
-
### $Release: 2.
|
5
|
+
### $Release: 2.2.0 $
|
6
6
|
### $Copyright: copyright(c) 2021 kwatch@gmail.com $
|
7
7
|
### $License: MIT License $
|
8
8
|
###
|
@@ -23,7 +23,7 @@ end
|
|
23
23
|
module Benry::CmdOpt
|
24
24
|
|
25
25
|
|
26
|
-
VERSION = '$Release: 2.
|
26
|
+
VERSION = '$Release: 2.2.0 $'.split()[1]
|
27
27
|
|
28
28
|
|
29
29
|
def self.new()
|
@@ -142,6 +142,12 @@ module Benry::CmdOpt
|
|
142
142
|
item
|
143
143
|
end
|
144
144
|
|
145
|
+
def add_item(item)
|
146
|
+
#; [!a693h] adds option item into current schema.
|
147
|
+
@items << item
|
148
|
+
self
|
149
|
+
end
|
150
|
+
|
145
151
|
def option_help(width_or_format=nil, all: false)
|
146
152
|
#; [!0aq0i] can take integer as width.
|
147
153
|
#; [!pcsah] can take format string.
|
@@ -320,6 +326,7 @@ module Benry::CmdOpt
|
|
320
326
|
end
|
321
327
|
|
322
328
|
attr_reader :key, :optdef, :desc, :short, :long, :param, :type, :rexp, :enum, :range, :detail, :value, :tag, :callback
|
329
|
+
attr_writer :desc, :detail, :hidden, :important, :tag # !!experimental!!
|
323
330
|
alias pattern rexp # for backward compatibility
|
324
331
|
alias help desc # for backward compatibility
|
325
332
|
|
data/test/cmdopt_test.rb
CHANGED
@@ -256,6 +256,19 @@ Oktest.scope do
|
|
256
256
|
end
|
257
257
|
|
258
258
|
|
259
|
+
topic '#add_item()' do
|
260
|
+
|
261
|
+
spec "[!a693h] adds option item into current schema." do
|
262
|
+
item = Benry::CmdOpt::SchemaItem.new(:quiet, "-q", "quiet", "q", nil, nil, false)
|
263
|
+
sc = Benry::CmdOpt::Schema.new
|
264
|
+
sc.add_item(item)
|
265
|
+
ok {sc.to_s} == <<"END"
|
266
|
+
-q : quiet
|
267
|
+
END
|
268
|
+
end
|
269
|
+
|
270
|
+
end
|
271
|
+
|
259
272
|
topic '#option_help()' do
|
260
273
|
|
261
274
|
before do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benry-cmdopt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kwatch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oktest
|