rhcp_shell 0.2.21 → 0.2.22
Sign up to get free protection for your applications and to get access to all the features.
@@ -14,10 +14,11 @@ def add_detail_command(broker)
|
|
14
14
|
puts "invalid row index - please specify a number between 1 and #{row_count}"
|
15
15
|
return
|
16
16
|
end
|
17
|
-
puts "displaying details about row \# #{row_index}"
|
18
|
-
@last_response.data[row_index - 1]
|
19
|
-
|
20
|
-
|
17
|
+
puts "displaying details about row \# #{row_index}"
|
18
|
+
@last_response.data[row_index - 1]
|
19
|
+
# @last_response.data[row_index - 1].each do |k,v|
|
20
|
+
# puts " #{k}\t#{v}"
|
21
|
+
# end
|
21
22
|
|
22
23
|
}
|
23
24
|
).add_param(RHCP::CommandParam.new("row_index", "the index of the row you want to see details about",
|
@@ -27,7 +28,8 @@ def add_detail_command(broker)
|
|
27
28
|
}
|
28
29
|
)
|
29
30
|
)
|
30
|
-
command.result_hints[:display_type] = "hidden"
|
31
|
+
#command.result_hints[:display_type] = "hidden"
|
32
|
+
command.result_hints[:display_type] = "hash"
|
31
33
|
broker.register_command command
|
32
34
|
|
33
35
|
end
|
@@ -45,6 +45,7 @@ def add_help_commands(broker)
|
|
45
45
|
puts "Parameters:"
|
46
46
|
command.params.sort { |a,b| a.name <=> b.name }.each do |param|
|
47
47
|
default_value = param.default_value != nil ? " (default: #{param.default_value})" : ''
|
48
|
+
context_key = param.autofill_context_key != nil ? " (context key: #{param.autofill_context_key})" : ''
|
48
49
|
param_name = param.name
|
49
50
|
if param.is_default_param
|
50
51
|
param_name += " *"
|
@@ -52,7 +53,7 @@ def add_help_commands(broker)
|
|
52
53
|
if param.allows_extra_values
|
53
54
|
param_name += " ~"
|
54
55
|
end
|
55
|
-
puts sprintf(" %-20s %s%s\n", param_name, param.description, default_value)
|
56
|
+
puts sprintf(" %-20s %s%s%s\n", param_name, param.description, default_value, context_key)
|
56
57
|
end
|
57
58
|
if command.accepts_extra_params
|
58
59
|
puts "This command accepts extra parameters."
|
@@ -82,4 +83,4 @@ def add_help_commands(broker)
|
|
82
83
|
)
|
83
84
|
command.result_hints[:display_type] = "hidden"
|
84
85
|
broker.register_command command
|
85
|
-
end
|
86
|
+
end
|
@@ -183,7 +183,12 @@ class RHCPShellBackend < ShellBackend
|
|
183
183
|
begin
|
184
184
|
$logger.debug("(ShellBackend) gonna execute command '#{@command_selected.name}' on broker '#{@command_broker}'")
|
185
185
|
command = @command_broker.get_command(@command_selected.name)
|
186
|
-
|
186
|
+
context = RHCP::Context.new()
|
187
|
+
if @command_broker.context.request_context_id
|
188
|
+
puts "setting request context id to #{@command_broker.context.request_context_id}"
|
189
|
+
context.request_context_id = @command_broker.context.request_context_id
|
190
|
+
end
|
191
|
+
request = RHCP::Request.new(command, @collected_values, context)
|
187
192
|
response = @command_broker.execute(request)
|
188
193
|
|
189
194
|
if (response.status == RHCP::Response::Status::OK)
|
@@ -354,7 +359,7 @@ class RHCPShellBackend < ShellBackend
|
|
354
359
|
end
|
355
360
|
|
356
361
|
def complete(word = "")
|
357
|
-
|
362
|
+
#$logger.debug "collecting completion values for '#{word}'"
|
358
363
|
|
359
364
|
Thread.current['broker'] = @command_broker
|
360
365
|
|
data/lib/rhcp_shell/version.rb
CHANGED
metadata
CHANGED
@@ -1,96 +1,78 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhcp_shell
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.22
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 21
|
10
|
-
version: 0.2.21
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Philipp T.
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-10-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: rhcp
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 9
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 1
|
32
|
-
- 9
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 0.1.9
|
34
22
|
type: :runtime
|
35
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.1.9
|
36
30
|
description: command line shell for RHCP
|
37
31
|
email: philipp at virtualop dot org
|
38
|
-
executables:
|
32
|
+
executables:
|
39
33
|
- rhcp_shell
|
40
34
|
extensions: []
|
41
|
-
|
42
35
|
extra_rdoc_files: []
|
43
|
-
|
44
|
-
files:
|
36
|
+
files:
|
45
37
|
- bin/rhcp_shell
|
46
|
-
- lib/
|
47
|
-
- lib/rhcp_shell/rhcp_shell_backend.rb
|
38
|
+
- lib/rhcp_shell/base_shell.rb
|
48
39
|
- lib/rhcp_shell/display_types/hash.rb
|
49
40
|
- lib/rhcp_shell/display_types/table.rb
|
50
41
|
- lib/rhcp_shell/version.rb
|
51
|
-
- lib/rhcp_shell/
|
52
|
-
- lib/rhcp_shell/
|
53
|
-
- lib/rhcp_shell/base_shell.rb
|
54
|
-
- lib/rhcp_shell/local_commands/exit.rb
|
42
|
+
- lib/rhcp_shell/local_commands/context.rb
|
43
|
+
- lib/rhcp_shell/local_commands/help.rb
|
55
44
|
- lib/rhcp_shell/local_commands/set_prompt.rb
|
45
|
+
- lib/rhcp_shell/local_commands/exit.rb
|
56
46
|
- lib/rhcp_shell/local_commands/detail.rb
|
57
|
-
- lib/rhcp_shell/
|
58
|
-
- lib/rhcp_shell/
|
47
|
+
- lib/rhcp_shell/util/colorize.rb
|
48
|
+
- lib/rhcp_shell/rhcp_shell_backend.rb
|
49
|
+
- lib/rhcp_shell/shell_backend.rb
|
50
|
+
- lib/test.log
|
59
51
|
- lib/rhcp_shell.rb
|
60
|
-
- test/rhcp_shell_backend_test.rb
|
61
52
|
- test/setup_test_registry.rb
|
53
|
+
- test/rhcp_shell_backend_test.rb
|
62
54
|
homepage: http://rubyforge.org/projects/rhcp
|
63
55
|
licenses: []
|
64
|
-
|
65
56
|
post_install_message:
|
66
57
|
rdoc_options: []
|
67
|
-
|
68
|
-
require_paths:
|
58
|
+
require_paths:
|
69
59
|
- lib
|
70
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
61
|
none: false
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
|
77
|
-
- 0
|
78
|
-
version: "0"
|
79
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
67
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
version: "0"
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
88
72
|
requirements: []
|
89
|
-
|
90
73
|
rubyforge_project:
|
91
|
-
rubygems_version: 1.8.
|
74
|
+
rubygems_version: 1.8.25
|
92
75
|
signing_key:
|
93
76
|
specification_version: 3
|
94
77
|
summary: command line shell for RHCP
|
95
78
|
test_files: []
|
96
|
-
|