ultra_command_line 0.4.10 → 0.4.12

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
  SHA1:
3
- metadata.gz: 6331e815543a9129e303135a5cdf58740e9f0b8b
4
- data.tar.gz: a1ed588240764568e0a40641dba89ffd6ecec01b
3
+ metadata.gz: c7e8145f57a5104d0baa5b6e4af2808edb459c50
4
+ data.tar.gz: 39483fbff2577e4b4eab571088b4e6b6df4c7b89
5
5
  SHA512:
6
- metadata.gz: ce1a9299903370ace23a8875b6713a77988bd132e5e9508fed5c814eab0cfba8d5c1cb9706bcd2125601188ab0ff270f99c2a8c93a1152e1e9ba4a89e9302c3a
7
- data.tar.gz: 26801b1fdd1227582ae87a534dc76c5ec10bc18397f63ff008e83db9da6edcd8d4fa2061460feeac1a80044dbe349ed9c8a841ac6a4ad792f4192343c2e3bca3
6
+ metadata.gz: ba6516fface565ddc5d8881ed39da52528cc625d4c57f73139afd5ad95f2180012296f066ca5ebfb7cced90252242a5e01bccbdd007334d030f89a667a9248e2
7
+ data.tar.gz: a44a8fb669154fbc09da763c5e986375441332c5a76cd270533ef814016d0de7966bf68ddefaab1283b904aa54def98c58e8a52b9544c8392cb4d10db981fa97
@@ -26,7 +26,7 @@ module UltraCommandLine
26
26
  output << banner
27
27
  unless options.empty?
28
28
  output << build_separator(title)
29
- output.concat options.map(&:help_line)
29
+ output.concat options.sort{|a,b| a.name <=> b.name }.map(&:help_line)
30
30
  end
31
31
  output
32
32
  end
@@ -6,7 +6,7 @@ module UltraCommandLine
6
6
  DEFAULT_SUMMARY = 'Option summary not provided.'.freeze
7
7
  attr_reader :name, :type
8
8
  attr_reader :short_aliases, :long_aliases
9
- attr_accessor :summary, :default, :description, :help, :dependencies, :incompatibilities
9
+ attr_accessor :summary, :default, :description, :help, :dependencies, :incompatibilities, :sub_command
10
10
 
11
11
  def initialize(name, type, options = {})
12
12
  @name = name
@@ -33,7 +33,7 @@ module UltraCommandLine
33
33
  class << self; include UltraCommandLine::Commands::MainCommand; end
34
34
  end
35
35
  self.banner = banner
36
- @options = options
36
+ register_options(options)
37
37
  @aliases = [self.name]
38
38
  @type = type
39
39
  end
@@ -50,6 +50,11 @@ module UltraCommandLine
50
50
 
51
51
  attr_writer :manager
52
52
 
53
+ def register_options(options)
54
+ options.each { |option| option.sub_command = self }
55
+ @options = options
56
+ end
57
+
53
58
  def self_view_of_manager_cmd_line_args
54
59
  manager.cmd_line_args_for_command self
55
60
  end
@@ -1,3 +1,3 @@
1
1
  module UltraCommandLine
2
- VERSION = '0.4.10'.freeze
2
+ VERSION = '0.4.12'.freeze
3
3
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_development_dependency 'bundler', '~> 1.15'
23
+ spec.add_development_dependency 'bundler'
24
24
  spec.add_development_dependency 'rake', '~> 10.0'
25
25
  spec.add_development_dependency 'rspec', '~> 3.0'
26
26
  spec.add_development_dependency 'simplecov'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultra_command_line
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent B.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-01 00:00:00.000000000 Z
11
+ date: 2019-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.15'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.15'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement