hiiro 0.1.290 → 0.1.291

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: 39db2e632092be3971a6cb08da3a0a4a4ad3accfc42c6978bccee29ebd9c185f
4
- data.tar.gz: 02e163c3f894838a6e1ef31d96d2b9f3011bf0ff53e50eee71f4f8c4c8ff1fb4
3
+ metadata.gz: 03a9ad967ffc6e338367882dd85b3305099e521dc7a0a2341acf71257ca22bde
4
+ data.tar.gz: 80f4746d3cdb168b9275e8ca4e55822d356966f4467f147b68741cde3045cfa6
5
5
  SHA512:
6
- metadata.gz: 67bdae476921c82c1aaf61195768b1145b235756ba73687e28ea918dfe43ea8d907471d38d1084dfa2caf82921fe594145f9183073480adc8b140a6d6c998723
7
- data.tar.gz: 9a824284df02e880db1bb13496610b1ae39c2cbdbbae9f09176640ff8bb6e50d3e9c1a56b84491ef6d5b6ff0742db0cb9f84fe5c3c2a67abc58b42d581279c8d
6
+ metadata.gz: 6f5076627ad3767f575122e566090160a35953059efb115e89509a855af089dec0f5f32336c33cf001cc3bc8d6fa3a364bde840ad4e1d7a2274c354c0e59b35f
7
+ data.tar.gz: 7b6cdcbe3c7640f6fbf27d42ee42aa72fcc6644d5f11c0ddec482d6ea98de8dc5f3712606d221e1c520acbbc66cb3c60fae1eea8ae2c8bf4d7175345465da2bd
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
  ```markdown
2
+ ## v0.1.291 (2026-03-26)
3
+
4
+ ### Added
5
+ - `Options#mutual_exclusion(*names)` — star-topology mutual exclusion: first flag is the hub (clears all others when set); any other flag only clears the hub (spokes can coexist freely); last encountered in argv wins
6
+ - `h pr ls`: new `--all`/`-a` flag (show all tracked PRs, no filter); all filter flags are declared mutually exclusive so `-oa`, `-ao`, `--all --active` etc. do the right thing
7
+
2
8
  ## v0.1.290 (2026-03-26)
3
9
 
4
10
  ### Fixed
data/bin/h-pr CHANGED
@@ -238,7 +238,9 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
238
238
  flag(:verbose, short: 'v', desc: 'multi-line output per PR')
239
239
  flag(:checks, short: 'C', desc: 'show individual check run details')
240
240
  flag(:diff, short: 'd', desc: 'open diff for selected PR')
241
+ flag(:all, short: 'a', desc: 'show all tracked PRs (no filter)')
241
242
  instance_eval(&FILTER_OPTS)
243
+ mutual_exclusion(:all, :active, :merged, :drafts, :red, :green, :pending, :conflicts)
242
244
  }
243
245
 
244
246
  if opts.help
data/lib/hiiro/options.rb CHANGED
@@ -63,6 +63,19 @@ class Hiiro
63
63
  self
64
64
  end
65
65
 
66
+ # Declare a mutual exclusion group with star topology.
67
+ # The first name is the hub; the rest are spokes.
68
+ # Setting the hub clears all spokes.
69
+ # Setting a spoke clears only the hub.
70
+ # Spokes can still be combined with each other freely.
71
+ # Two-member groups are fully symmetric (hub == spoke).
72
+ # Last flag encountered in argv always wins.
73
+ def mutual_exclusion(*names)
74
+ @mutex_groups ||= []
75
+ @mutex_groups << names.map(&:to_sym)
76
+ self
77
+ end
78
+
66
79
  private
67
80
 
68
81
  def deconflict_short(short)
@@ -82,7 +95,7 @@ class Hiiro
82
95
  end
83
96
 
84
97
  def parse(args)
85
- Args.new(@definitions, args.flatten.compact)
98
+ Args.new(@definitions, args.flatten.compact, mutex_groups: @mutex_groups || [])
86
99
  end
87
100
 
88
101
  def parse!(args)
@@ -93,8 +106,9 @@ class Hiiro
93
106
  attr_reader :remaining_args, :original_args
94
107
  alias args remaining_args
95
108
 
96
- def initialize(definitions, raw_args)
109
+ def initialize(definitions, raw_args, mutex_groups: [])
97
110
  @definitions = definitions
111
+ @mutex_groups = mutex_groups
98
112
  @original_args = raw_args.dup.freeze
99
113
  @values = {}
100
114
  @remaining_args = []
@@ -182,7 +196,7 @@ class Hiiro
182
196
  return unless defn
183
197
 
184
198
  if defn.flag? || defn.flag_active?(@values)
185
- @values[defn.name] = !defn.default
199
+ set_flag(defn, !defn.default)
186
200
  else
187
201
  value ||= args.shift
188
202
  store_value(defn, value)
@@ -197,7 +211,7 @@ class Hiiro
197
211
  next unless defn
198
212
 
199
213
  if defn.flag? || defn.flag_active?(@values)
200
- @values[defn.name] = !defn.default
214
+ set_flag(defn, !defn.default)
201
215
  elsif idx == chars.length - 1
202
216
  store_value(defn, args.shift)
203
217
  else
@@ -207,6 +221,28 @@ class Hiiro
207
221
  end
208
222
  end
209
223
 
224
+ def set_flag(defn, value)
225
+ # Star topology: group[0] is the hub.
226
+ # Setting the hub → clears all spokes (group[1..])
227
+ # Setting a spoke → clears only the hub (group[0])
228
+ # This lets spokes coexist with each other (e.g. --red --drafts is fine)
229
+ # while still preventing any spoke from combining with the hub (--all).
230
+ @mutex_groups.each do |group|
231
+ next unless group.include?(defn.name)
232
+ hub, *spokes = group
233
+ if defn.name == hub
234
+ spokes.each do |spoke|
235
+ spoke_defn = @definitions[spoke]
236
+ @values[spoke] = spoke_defn.default if spoke_defn
237
+ end
238
+ else
239
+ hub_defn = @definitions[hub]
240
+ @values[hub] = hub_defn.default if hub_defn
241
+ end
242
+ end
243
+ @values[defn.name] = value
244
+ end
245
+
210
246
  def store_value(defn, value)
211
247
  coerced = defn.coerce(value)
212
248
  if defn.multi
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.290"
2
+ VERSION = "0.1.291"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.290
4
+ version: 0.1.291
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota