fuelcell 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/test +3 -3
- data/bin/world.rb +3 -3
- data/lib/fuelcell/cli.rb +6 -2
- data/lib/fuelcell/help/builder.rb +2 -1
- data/lib/fuelcell/parser/parsing_strategy.rb +4 -3
- data/lib/fuelcell/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWMyNzZhNWVlZThhNWNhZjI4ZGY2ODNiZTMwMWIwNGJmYzZkYmI3Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzZmMjRmYmJhMWM0NmJmNmRmYjA1MGEyYTA3YzRhMzY0NmUyZGRlNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2JkMjBkMGMyOWU3YWE0MTU3NzI2Njk4YjJjNzQ1MGVjODk3ZTc4Y2YwZDI4
|
10
|
+
ZDc2ZjNkNDU5ZDcwZTgyOTQ4NDc0NTc2ZjFiN2M0YjFlNzM5ZDM1YjBhNGEz
|
11
|
+
YWMwYzBhOTA4ZTA5MDM5MzRmZDY3OTEzZjY4ZmU2YjdlMmQ3OGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODU1MmU2MDg1NTU1ZDMwNGE3NjdkMGMxYWMxY2Q3ZDhhZmNmZjg3NzVhNDNk
|
14
|
+
NGUzMDI1NzAzOTNhNWU2YmQ4NDYwZDc1NGU1M2RkZjFmZDFlMmJjOTdhZTQ3
|
15
|
+
YWIzNDQ2ZTQ1MTdhMmVkNWRlZTBjZTFjYjlhNzBmZjIwMTEzODk=
|
data/bin/test
CHANGED
data/bin/world.rb
CHANGED
data/lib/fuelcell/cli.rb
CHANGED
@@ -40,7 +40,7 @@ module Fuelcell
|
|
40
40
|
cmd = root.locate(cmd_args, raw_args)
|
41
41
|
root.add_global_options(cmd)
|
42
42
|
begin
|
43
|
-
parser.call(cmd, raw_args)
|
43
|
+
parser.call(cmd, cmd_args, raw_args)
|
44
44
|
rescue Exception => e
|
45
45
|
shell.error e.message
|
46
46
|
shell.failure_exit
|
@@ -56,10 +56,14 @@ module Fuelcell
|
|
56
56
|
cmd = context[:cmd]
|
57
57
|
opts = context[:opts] || {}
|
58
58
|
args = context[:args] || []
|
59
|
+
cmd_args = context[:cmd_args]
|
59
60
|
cli_shell = context[:shell] || shell
|
60
61
|
|
61
|
-
|
62
|
+
unless cmd.callable?
|
63
|
+
return root['help'].call(opts, cmd_args, shell)
|
64
|
+
end
|
62
65
|
|
66
|
+
cmd = handle_callable_option(root, cmd)
|
63
67
|
cmd.call(opts, args, cli_shell)
|
64
68
|
|
65
69
|
end
|
@@ -3,7 +3,8 @@ module Fuelcell
|
|
3
3
|
class Builder
|
4
4
|
|
5
5
|
def call(root, args, help = {})
|
6
|
-
|
6
|
+
args = args.is_a?(Array) ? args : args.raw
|
7
|
+
cmd = args.empty? ? root : root.locate(args)
|
7
8
|
path = args.join(' ').strip
|
8
9
|
build_usage(root.name, path, cmd, help)
|
9
10
|
build_options(cmd.opts, help)
|
@@ -41,7 +41,7 @@ module Fuelcell
|
|
41
41
|
# @param raw_args [Array] raw args from ARGV
|
42
42
|
# @param opts [Hash] stores processed options
|
43
43
|
# @return [Array] the process options and processed args
|
44
|
-
def call(cmd, raw_args, opts = Fuelcell::Action::OptResults.new)
|
44
|
+
def call(cmd, cmd_args, raw_args, opts = Fuelcell::Action::OptResults.new)
|
45
45
|
ignores = ignore_handler.call(raw_args)
|
46
46
|
args = run_option_handlers(cmd, raw_args, opts)
|
47
47
|
args = arg_handler.call(cmd, args)
|
@@ -51,7 +51,7 @@ module Fuelcell
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
format_return(cmd, opts, args, ignores)
|
54
|
+
format_return(cmd, opts, cmd_args, args, ignores)
|
55
55
|
end
|
56
56
|
|
57
57
|
private
|
@@ -67,8 +67,9 @@ module Fuelcell
|
|
67
67
|
args
|
68
68
|
end
|
69
69
|
|
70
|
-
def format_return(cmd, opts, args, ignores)
|
70
|
+
def format_return(cmd, opts, cmd_args, args, ignores)
|
71
71
|
{
|
72
|
+
cmd_args: cmd_args,
|
72
73
|
cmd: cmd,
|
73
74
|
opts: opts,
|
74
75
|
args: args,
|
data/lib/fuelcell/version.rb
CHANGED