mothership 0.0.6 → 0.0.7
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.
- data/lib/mothership.rb +2 -1
- data/lib/mothership/command.rb +1 -1
- data/lib/mothership/parser.rb +14 -2
- data/lib/mothership/version.rb +1 -1
- metadata +4 -4
data/lib/mothership.rb
CHANGED
data/lib/mothership/command.rb
CHANGED
data/lib/mothership/parser.rb
CHANGED
@@ -14,14 +14,26 @@ class Mothership
|
|
14
14
|
inputs
|
15
15
|
end
|
16
16
|
|
17
|
-
def parse_flags(inputs, argv)
|
17
|
+
def parse_flags(inputs, argv, find_in = nil)
|
18
|
+
local = nil
|
18
19
|
args = []
|
19
20
|
|
20
21
|
until argv.empty?
|
21
22
|
flag = normalize_flag(argv.shift, argv)
|
22
23
|
|
23
|
-
name = @command.flags[flag]
|
24
|
+
name = local && local.flags[flag] || @command.flags[flag]
|
24
25
|
unless name
|
26
|
+
# assume first argument is subcommand
|
27
|
+
if args.empty? && find_in && !local
|
28
|
+
local = find_in[flag.to_sym]
|
29
|
+
end
|
30
|
+
|
31
|
+
args << flag
|
32
|
+
next
|
33
|
+
end
|
34
|
+
|
35
|
+
# skip flags defined by the local cmd
|
36
|
+
if local && local.inputs[name]
|
25
37
|
args << flag
|
26
38
|
next
|
27
39
|
end
|
data/lib/mothership/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mothership
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alex Suraci
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
18
|
+
date: 2012-07-19 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|