ace-support-cli 0.6.3 → 0.6.7

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: 4c45ddfd0f8690753b1f61d0bd7edd9b7a0b6f2061ee5bb1d8956a3e856578da
4
- data.tar.gz: 110e674c92fa17291934c47baec9f8e1296f86263f3b6c4e14e07f0a6a8830a8
3
+ metadata.gz: dffb8ed525e3e2a4e8c779b1c320cb3d9445c10bd9f2c5587f681b743dc54e66
4
+ data.tar.gz: 284d72fb8c5de3ceaebde702ce3dd5dee21740174d7f4a19055b306cad08ac9c
5
5
  SHA512:
6
- metadata.gz: 220feda7572bad571d6a6afd12762a9d97dd312554fb43a530fa7a1c0038847769d90422bddd27f570fdbf5bc20c882739670db5fbe3ee3ae6182ad24433e86a
7
- data.tar.gz: 65f4679717750db4105ecde69012680d2125344f441b8188036827089c2561f73577cd2b59e431edece55abbcd807c21d073919541ee88027854c535df5fab12
6
+ metadata.gz: e11affb46f531af49fe99bc27394cac530ff53b4de1c42085c70ab0dcb7eb0284d3cca0c1c08a5efdd99b15f3084e0ce58efb593bd72222035ad1e86bcfa4a67
7
+ data.tar.gz: 101c391ba4b4088c530a6da9f467123cfa073a63d2ebeb6a693bdf5d0be99dc2b606c704b1c63ef7ac5ec1753922008928c14cbafb9f51b470f1f956e0e0370a
data/CHANGELOG.md CHANGED
@@ -4,6 +4,32 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.6.7] - 2026-04-16
8
+
9
+ ### Fixed
10
+ - Hid misleading rich-help `(default: false)` output for optional-value flags so shorthand CLI forms like bare `--capture` and `--wait` are documented accurately.
11
+
12
+ ## [0.6.6] - 2026-04-16
13
+
14
+ ### Fixed
15
+ - Added optional-value string flag parsing so ACE CLIs can accept shorthand forms like bare `--capture` without breaking existing option and positional parsing behavior.
16
+
17
+ ## [0.6.5] - 2026-04-13
18
+
19
+ ### Changed
20
+ - **ace-support-cli v0.6.5**: Standardized shared package tests to the fast-only layout and updated testing flow defaults.
21
+
22
+ ## [0.6.4] - 2026-04-11
23
+
24
+ ### Fixed
25
+ - **ace-support-cli v0.6.4**: Corrected top-level `--help` usage output formatting so usage is rendered consistently as `Usage: <program> [COMMAND]`, and aligned help tests to validate this contract.
26
+
27
+ ### Changed
28
+ - Migrated deterministic test layout to `test/fast/` for fast-only package coverage.
29
+ - Documented fast-only testing contract in README and retained package verification commands:
30
+ - `ace-test ace-support-cli`
31
+ - `ace-test ace-support-cli all`
32
+
7
33
  ## [0.6.3] - 2026-03-29
8
34
 
9
35
  ### Technical
data/README.md CHANGED
@@ -30,6 +30,18 @@
30
30
 
31
31
  **Keep agent invocations safe** - preserve a stable CLI contract so coding agents can call `ace-*` tools reliably in mixed human/agent workflows.
32
32
 
33
+ ## Testing
34
+
35
+ This package is **fast-only** in the ACE testing model.
36
+
37
+ - Deterministic test coverage lives under `test/fast/`.
38
+ - This migration does not introduce `test/feat/` or `test/e2e/` for this package.
39
+
40
+ Verification commands:
41
+
42
+ - `ace-test ace-support-cli`
43
+ - `ace-test ace-support-cli all`
44
+
33
45
  ---
34
46
 
35
47
  Part of [ACE](https://github.com/cs3b/ace)
@@ -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
 
@@ -13,13 +13,14 @@ module Ace
13
13
  end
14
14
 
15
15
  def render
16
+ usage = "Usage: #{resolved_program_name} [COMMAND]"
16
17
  commands = visible_commands
17
18
  groups = command_groups
18
- output = if groups && !groups.empty?
19
+ output = [usage, if groups && !groups.empty?
19
20
  format_grouped(commands, groups)
20
21
  else
21
22
  format_flat(commands, header: "COMMANDS")
22
- end
23
+ end].join("\n\n")
23
24
 
24
25
  examples = help_examples
25
26
  output += "\n\n#{format_examples(examples)}" if examples && !examples.empty?
@@ -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.3"
6
+ VERSION = "0.6.7"
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.3
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Czyz
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-03-29 00:00:00.000000000 Z
10
+ date: 2026-04-26 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.