hiiro 0.1.221 → 0.1.222

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hiiro/version.rb +1 -1
  3. data/lib/hiiro.rb +9 -7
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de890107cb43e9b6f6cf34020f4c2c2083d93e19336f30f8c78a0a14368a0b79
4
- data.tar.gz: 18797bfa2b31b7d162a03ad1144228e320ba1ffc9e8d4377f77f51fa1efa06dd
3
+ metadata.gz: dd9fd771adc0be25c17cca7f5dcf1f5605038b5469ffff60065fb13265089fdb
4
+ data.tar.gz: 93468bb6207dc988b56270904c0555df70cb96e3d3a266b76c00dc0063620af1
5
5
  SHA512:
6
- metadata.gz: 133d7ca0775d50002b3f49f59fd75ed935f8eb2a0ba69747c49ada7ddb29eb52f32b319ee2aa24dccd693b6906a32c071f8128b563f5faace521f304b09c74b8
7
- data.tar.gz: a6be7f17f45b6db61209c13b703a601044ec7a6d593ec8b8b418ce94cbda95e2aa4d5c6f1ec0f4cafcd467ff984ee7a157bba6110eb16c322f949b67f6d654ad
6
+ metadata.gz: dd6344a671c11f345ef1417956f4a0cacd7865d95f5ad7ac0686cfb681e0fd4bc667d185ede6a25145c69a85e0cedf240bfd58736c0d8f7a19c3c4d39fd730b1
7
+ data.tar.gz: f6ff449932b46f6df6ce4469fd74423fe0785227c668e096115ce087511e4cf26272eed32fe60d9217fdf6df34bb1483fc313d8116c4af5848e2afef24dd43f7
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.221"
2
+ VERSION = "0.1.222"
3
3
  end
data/lib/hiiro.rb CHANGED
@@ -355,17 +355,19 @@ class Hiiro
355
355
 
356
356
  max_name = sorted.map { |r| r.subcommand_name.length }.max || 0
357
357
  max_type = sorted.map { |r| r.type.to_s.length }.max || 0
358
- max_params = sorted.map { |r| r.params_string.to_s.length }.max || 0
359
358
 
360
- sorted.each do |r|
359
+ params_with_opts = sorted.map do |r|
360
+ parts = [r.params_string, (r.respond_to?(:opts_hint) ? r.opts_hint : nil)]
361
+ parts.compact.reject(&:empty?).join(' ')
362
+ end
363
+ max_params = params_with_opts.map(&:length).max || 0
364
+
365
+ sorted.each_with_index do |r, i|
361
366
  name = r.subcommand_name.ljust(max_name)
362
367
  type = "(#{r.type})".ljust(max_type + 2)
363
- params = r.params_string
364
- params_col = params ? params.ljust(max_params) : ''.ljust(max_params)
368
+ params_col = params_with_opts[i].ljust(max_params)
365
369
  location = shorten_location(r.location, vars)
366
- hint = r.respond_to?(:opts_hint) ? r.opts_hint : nil
367
- hint_col = hint && !hint.empty? ? " #{hint}" : ""
368
- puts " #{name} #{params_col} #{type} #{location}#{hint_col}"
370
+ puts " #{name} #{params_col} #{type} #{location}"
369
371
  end
370
372
  end
371
373
 
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.221
4
+ version: 0.1.222
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota