mcli 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mcli/command.rb +7 -0
- data/lib/mcli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d382a3a21abb134734048886960af562c4e001a4baa7ebde1503d0137878102
|
4
|
+
data.tar.gz: 9c4c329134742bdd6a021321fa7eb7c4963e6fea27b2f025e90354c2aa6e7218
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f834278a7d95502980f236167910ee90693674b9317afca3f10986b3046ce69c2f8262c278e0c2484442dbc7cad40300bf0bb42cd50982dac81044c3d2f1fd
|
7
|
+
data.tar.gz: f1f15136da477e7290fb50da6060027ef8d45b8ace8f21296e1db11a5f0d9476e32f4df00f7de7bb77c9de65193a800cc5d94bbbb2158763f54354c30036e5c4
|
data/lib/mcli/command.rb
CHANGED
@@ -37,6 +37,8 @@ class MCLI::Command
|
|
37
37
|
|
38
38
|
def create_parser
|
39
39
|
OptionParser.new.tap do |parser|
|
40
|
+
parser.program_name = self.class.command_name
|
41
|
+
|
40
42
|
parser.on("-h", "--help", "Help") do
|
41
43
|
raise MCLI::HelpError.new
|
42
44
|
end
|
@@ -58,6 +60,7 @@ class MCLI::Command
|
|
58
60
|
end
|
59
61
|
|
60
62
|
def register_as(command_name)
|
63
|
+
@command_name = command_name
|
61
64
|
MCLI::CommandGroup.register(command_name, self)
|
62
65
|
end
|
63
66
|
|
@@ -73,6 +76,10 @@ class MCLI::Command
|
|
73
76
|
@capture_all
|
74
77
|
end
|
75
78
|
|
79
|
+
def command_name
|
80
|
+
@command_name
|
81
|
+
end
|
82
|
+
|
76
83
|
def call
|
77
84
|
new(ARGV).tap do |command|
|
78
85
|
begin
|
data/lib/mcli/version.rb
CHANGED