fylla 0.4.1 → 0.4.2

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: 701cc5a9da14fb950ce54b98a94770b8098aec8b8b91d1e53026e17786cd2e65
4
- data.tar.gz: e0e194e54c0b397ffd4692160344b453b3dd8b92485f12f7f17fc637807a1e14
3
+ metadata.gz: 8df92c7af5f47be7d590dd1c1d97ea046039c5505efe276ca8fccb0803ce97c9
4
+ data.tar.gz: 9c540d31e035a1bd88c78ff5c7974298e2c9b26b1c4f81d1c8711350017c17d2
5
5
  SHA512:
6
- metadata.gz: 2abca800e2d0008192cbadd1a71ef1739bd45a99171b115798bf1e4c707180bc7c4e06e7b7e6e267d8e2c5eba9b41665116b8fa652c1defc2c4d5e94978321d9
7
- data.tar.gz: 63cc5a776f52de405ebcc5f218e76186e9bba2b4e0ae117d0b2535948824b0c2c65f94b155272432e8603872147e5cb77b27ecbd9ec53d47e5215227c0e25eee
6
+ metadata.gz: c2f2353a5628e3ff079f05904a70cb6d0001a37edafe80e69d9c28ef72909ae34ecc63141fcc95d5e62ccd50a73deb2c90bb86be3dfb3b2a670e9792a73f0fac
7
+ data.tar.gz: d7fcb7fed553042ec87b6d3a913915396638b36fdfeda0e62a0fd9b691b2d0b09bfb867b453a5da844a0c93590c2e698901904a6a02d198cef1b95a5f8600590
@@ -97,7 +97,7 @@ module Fylla
97
97
  def generate_completion_string(command, class_options, context_name, style)
98
98
  builder = ''
99
99
  if command.is_a? ParsedSubcommand
100
- class_options = (class_options + command.class_options).uniq
100
+ class_options = parse_options((class_options + command.class_options).uniq)
101
101
  builder += map_to_completion_string(command.commands,
102
102
  context: context_name,
103
103
  class_options: class_options,
@@ -174,7 +174,7 @@ module Fylla
174
174
 
175
175
  def parse_options(options)
176
176
  options.map do |opt|
177
- description = opt.completion || opt.description || opt.banner
177
+ description = opt.completion || opt.description || opt.banner || opt.name.to_s.upcase
178
178
  ParsedOption.new(opt.name, description, opt.aliases)
179
179
  end
180
180
  end
@@ -1,6 +1,7 @@
1
1
  module Fylla
2
2
  class ParsedOption
3
3
  attr_accessor :aliases, :description, :name
4
+ attr_reader :completion, :banner # used just for parsing class_options recursively. Don't ever set these.
4
5
 
5
6
  def initialize(name, description, aliases)
6
7
  @name = name
@@ -1,3 +1,3 @@
1
1
  module Fylla
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.4.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fylla
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Thrailkill
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-30 00:00:00.000000000 Z
11
+ date: 2019-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler