ace-support-cli 0.6.5 → 0.6.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45837f5a66cdeaedc543fb607f4dce4b21070ed02482d68b031c7ed287ff4177
4
- data.tar.gz: 073652f79f5b2e76b666365c42e3c1ee57ecf7df67dcebb25d869fb169976972
3
+ metadata.gz: 9465d6244fddba266da89146b48e2fc8dfcebf87d835d93cc90bb14c553fb3d5
4
+ data.tar.gz: e2e2fd7b803bc14d8ef586a678a4e5c28c6b7c9833b05fb3f045e611e407de7d
5
5
  SHA512:
6
- metadata.gz: df7c9b4bcb11ded58fa2b5348a27237e022e21e18416247e7a4f3c3fc4849bd88173cdda6a484c36352220a2aa271cd6ce2f4b61bb83bb37ce5409565b57ff8c
7
- data.tar.gz: af27c4d0a6bd9038edf4cbd73cb2c80c17434cec397afc51873faaef8fc80a7628ce898a713ada153c95b6826fbf43210b9cfe7ac0ac3ad8bae6ea1c036b7c7d
6
+ metadata.gz: 94504fb7bcbc77c7342205ebd3ebe626eb1f137b28f41d62f08bd0395957134971cb8278ed85b15b5a6f9e702c63cc6713f0b9c53952846fd00ae6fc03b86528
7
+ data.tar.gz: 6714d4f23e9481f03a3c8bf2666296373c8d1860cb7e0246535388b3e9cf1261a2e7a31592e6f2fc54a37511c62d93b4e6ea316d372c38628c5c3a20e84dfe25
data/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+
8
+ ## [0.6.8] - 2026-09-02
9
+
10
+ ### Technical
11
+ - Included in the coordinated all-package patch release preparation for ACE monorepo review.
12
+ ## [0.6.7] - 2026-04-16
13
+
14
+ ### Fixed
15
+ - Hid misleading rich-help `(default: false)` output for optional-value flags so shorthand CLI forms like bare `--capture` and `--wait` are documented accurately.
16
+
17
+ ## [0.6.6] - 2026-04-16
18
+
19
+ ### Fixed
20
+ - Added optional-value string flag parsing so ACE CLIs can accept shorthand forms like bare `--capture` without breaking existing option and positional parsing behavior.
21
+
7
22
  ## [0.6.5] - 2026-04-13
8
23
 
9
24
  ### Changed
@@ -22,7 +22,7 @@ module Ace
22
22
  @description = text
23
23
  end
24
24
 
25
- def option(name, type: :string, default: nil, desc: "", aliases: [], values: nil, required: false, repeat: false, **_extra)
25
+ def option(name, type: :string, default: nil, desc: "", aliases: [], values: nil, required: false, repeat: false, optional_value: false, **_extra)
26
26
  @options ||= []
27
27
  @options << Models::Option.new(
28
28
  name: name,
@@ -32,7 +32,8 @@ module Ace
32
32
  aliases: aliases,
33
33
  values: values,
34
34
  required: required,
35
- repeat: repeat
35
+ repeat: repeat,
36
+ optional_value: optional_value
36
37
  )
37
38
  end
38
39
 
@@ -103,7 +103,7 @@ module Ace
103
103
  values = option_values(option)
104
104
  details << "(values: #{Array(values).join(", ")})" if values && !Array(values).empty?
105
105
  default = option_default(option)
106
- details << "(default: #{default.inspect})" unless default.nil?
106
+ details << "(default: #{default.inspect})" unless suppress_default_display?(option, default)
107
107
  details << "(required)" if option_required?(option)
108
108
 
109
109
  return label if details.empty?
@@ -204,6 +204,19 @@ module Ace
204
204
  false
205
205
  end
206
206
 
207
+ def self.option_optional_value?(option)
208
+ return option.optional_value if option.respond_to?(:optional_value)
209
+
210
+ false
211
+ end
212
+
213
+ def self.suppress_default_display?(option, default)
214
+ return true if default.nil?
215
+ return true if option_optional_value?(option) && default == false
216
+
217
+ false
218
+ end
219
+
207
220
  def self.option_boolean?(option)
208
221
  return option.boolean? if option.respond_to?(:boolean?)
209
222
 
@@ -7,9 +7,9 @@ module Ace
7
7
  class Option
8
8
  VALID_TYPES = %i[string integer float boolean array hash].freeze
9
9
 
10
- attr_reader :name, :type, :default, :desc, :aliases, :values, :required, :repeat
10
+ attr_reader :name, :type, :default, :desc, :aliases, :values, :required, :repeat, :optional_value
11
11
 
12
- def initialize(name:, type: :string, default: nil, desc: "", aliases: [], values: nil, required: false, repeat: false)
12
+ def initialize(name:, type: :string, default: nil, desc: "", aliases: [], values: nil, required: false, repeat: false, optional_value: false)
13
13
  @name = name.to_sym
14
14
  @type = type.to_sym
15
15
  @default = default
@@ -18,6 +18,7 @@ module Ace
18
18
  @values = values
19
19
  @required = required
20
20
  @repeat = repeat
21
+ @optional_value = optional_value
21
22
  validate!
22
23
  end
23
24
 
@@ -115,7 +115,7 @@ module Ace
115
115
  options[option.name] = current.merge(key => parsed_value)
116
116
  end
117
117
  else
118
- switches = value_switches(option, "VALUE")
118
+ switches = option.optional_value ? optional_value_switches(option, "VALUE") : value_switches(option, "VALUE")
119
119
  parser.on(*switches, String, desc) { |value| assign_option_value(options, option, value) }
120
120
  end
121
121
  end
@@ -136,6 +136,12 @@ module Ace
136
136
  end
137
137
  end
138
138
 
139
+ def optional_value_switches(option, value_label)
140
+ (option.aliases + [option.long_switch]).map do |switch|
141
+ "#{switch} [#{value_label}]"
142
+ end
143
+ end
144
+
139
145
  def parse_hash_pair(value, option)
140
146
  parts = value.split(/[=:]/, 2)
141
147
  raise ArgumentError, "Invalid value for #{option.long_switch}: expected key=value" if parts.length < 2
@@ -3,7 +3,7 @@
3
3
  module Ace
4
4
  module Support
5
5
  module Cli
6
- VERSION = "0.6.5"
6
+ VERSION = "0.6.8"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-support-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Czyz
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-04-20 00:00:00.000000000 Z
10
+ date: 2026-09-05 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Provides command DSL, option parsing, registry routing, and runner primitives
13
13
  for ACE CLI tools.