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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e37b3eb5a8294bfae3627f384720f843e2c6ae9c79ec0cc704b732368d46437
4
- data.tar.gz: 3a3b34226485ae5c0aaa3f3b90d6ba281b34f7843d5e03179235784af0fc2467
3
+ metadata.gz: 9308d0182f3f4a17d45f3b7a1f212a4f5f2112f4084d725b2de05271a908bb1d
4
+ data.tar.gz: f9b8e9066b9857d2693382f03bcbeacdd040695287d426d8ef8c28cf242f1cd1
5
5
  SHA512:
6
- metadata.gz: f1aae8384f952ddbc0ba5408e39e5b289d09c9b9e768a4cee237c723d7f0bef459b2ab7c8e3639705e8495790fb02bb6fced99bf9a3676e772d4b0c2d622961d
7
- data.tar.gz: 737074f681fa450d2e0fc9b82b85aedba8088db313b522c32b1c01cae6a68ed091da08ca437f58e543b0a6d896618c42a078ded25bba9fba971c3e3ec90bc82f
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
@@ -1,6 +1,6 @@
1
1
  # Benry-CmdOpt
2
2
 
3
- ($Release: 2.1.0 $)
3
+ ($Release: 2.2.0 $)
4
4
 
5
5
 
6
6
 
data/benry-cmdopt.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "benry-cmdopt"
5
- spec.version = "$Release: 2.1.0 $".split()[1]
5
+ spec.version = "$Release: 2.2.0 $".split()[1]
6
6
  spec.author = "kwatch"
7
7
  spec.email = "kwatch@gmail.com"
8
8
  spec.platform = Gem::Platform::RUBY
@@ -21,7 +21,7 @@
21
21
  <ul class="nav">
22
22
  </ul>
23
23
  </nav>
24
- <p>($Release: 2.1.0 $)</p>
24
+ <p>($Release: 2.2.0 $)</p>
25
25
  <section class="section" id="whats-this">
26
26
  <h2>What's This?</h2>
27
27
  <p>Benry-CmdOpt is a command option parser library, like <code>optparse.rb</code>
data/lib/benry/cmdopt.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  ###
5
- ### $Release: 2.1.0 $
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.1.0 $'.split()[1]
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.1.0
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-15 00:00:00.000000000 Z
11
+ date: 2023-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oktest