mcli 0.3.0 → 0.4.0

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: 58ba7853c0e14c2f1998e4d1dcce81cf5c99eb5d414ec720db0d4612a3b397d1
4
- data.tar.gz: b0a1caa1a951a1bec4468e384a494fffc6c8e83f6ec15e60ff93354e9cc86d7e
3
+ metadata.gz: 46a66749c3036b67941be0bd467f468a50bed5c65bf6339fa38e4f6860ae1576
4
+ data.tar.gz: ee8160680bd44f9e119b5703ac336e5794996ae86e75882e5c16209e524b3530
5
5
  SHA512:
6
- metadata.gz: 844fb154e3d2cca1395b478b9d306866f2491bf69ff478cdb3dce12e8ade22f168ba9a6edbf2b8df72d9cab6a6f9072654819a0c4f1b14f6803904d2a9f9ec98
7
- data.tar.gz: 2a6fd377bab075c2b873e01f2839ea4329ae615493dac1386a530434e8bad5ed6d7b54eff0dffc79e2adb94a9645ffe372731c5b84bf1675b93b12ebf1a19338
6
+ metadata.gz: 0aff53ff9cb2ac7cb05f984348851e6697cdba511fd3580be155d3fff4c3fc532569d18d8f6193634d6c11876938f5ecafea2605e98c2eaf62d171358febd261
7
+ data.tar.gz: a1523561c64404be6211ef640f667fb8932d9e31eb50fff3f06fddf8a9c0134dff1c7066d6dae681ec074596ce49769e909ed325e77dc682b75bc5aa236a7e51
data/lib/mcli.rb CHANGED
@@ -13,7 +13,7 @@ module MCLI
13
13
 
14
14
  CommandGroup.commands.fetch(command.to_s.to_sym) do |command|
15
15
  ARGV.unshift(command)
16
- CommandGroup.commands[:_root] || NullCommand
16
+ CommandGroup.root_command || NullCommand
17
17
  end.call
18
18
  end
19
19
  end
data/lib/mcli/command.rb CHANGED
@@ -56,6 +56,10 @@ class MCLI::Command
56
56
  MCLI::CommandGroup.register(command_name, self)
57
57
  end
58
58
 
59
+ def register_as_root
60
+ MCLI::CommandGroup.register_root(self)
61
+ end
62
+
59
63
  def capture_all!
60
64
  @capture_all = true
61
65
  end
@@ -4,6 +4,10 @@ class MCLI::CommandGroup
4
4
  commands[command_name] = command_klass
5
5
  end
6
6
 
7
+ def register_root(command_klass)
8
+ @root_command = command_klass
9
+ end
10
+
7
11
  def commands
8
12
  @commands ||= {}
9
13
  end
@@ -11,6 +15,10 @@ class MCLI::CommandGroup
11
15
  def clear
12
16
  @commands = {}
13
17
  end
18
+
19
+ def root_command
20
+ @root_command
21
+ end
14
22
  end
15
23
  end
16
24
 
data/lib/mcli/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module MCLI
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Thomas