kontena-plugin-shell 0.1.2 → 0.1.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 801cf73c70dd8538e82d12cadda2b3053a22c653
|
4
|
+
data.tar.gz: 09f9479d92170bdd9184280a08649201b2d667a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 144d82873724fd87cab4b4e6cf92b3e0d99aa78ab0a7cefbc486474b324492c5eca52eeb0429464c997fbe3a80d1e7ba3a126943c98558d22b2f21942bf2fee3
|
7
|
+
data.tar.gz: 3b6cddff8ec0b27a3a08982f937df571e558a919c4bdce1218e13dac2f1b9e99430d906642f92dd488c3f5bca68e6d0f539831eb08a81f19aec2b6144bd82c52
|
data/bin/kosh
CHANGED
@@ -16,7 +16,7 @@ end
|
|
16
16
|
|
17
17
|
ARGV.unshift('shell')
|
18
18
|
|
19
|
-
Kontena::PluginManager.instance.init
|
19
|
+
Kontena::PluginManager.respond_to?(:instance) ? Kontena::PluginManager.instance.init : Kontena::PluginManager.init
|
20
20
|
Kontena::MainCommand.run
|
21
21
|
__END__
|
22
22
|
Usage: kosh [options] [initial_context]
|
@@ -31,7 +31,8 @@ module Kontena::Plugin
|
|
31
31
|
end
|
32
32
|
|
33
33
|
if args.empty? || (args.size == 1 && args.first == 'help')
|
34
|
-
puts
|
34
|
+
puts
|
35
|
+
puts 'Kontena Shell commands:'
|
35
36
|
Shell.commands.each do |name, cmd|
|
36
37
|
next if cmd == Kontena::Plugin::Shell::KontenaCommand
|
37
38
|
puts sprintf(' %-29s %s', name, cmd.description)
|
@@ -27,13 +27,17 @@ module Kontena::Plugin
|
|
27
27
|
cmd.run([])
|
28
28
|
end
|
29
29
|
rescue Clamp::HelpWanted => ex
|
30
|
-
|
30
|
+
if args.include?('--help') || args.include?('-h')
|
31
|
+
puts cmd.class.help('')
|
32
|
+
else
|
31
33
|
context.concat(args)
|
32
34
|
end
|
33
35
|
rescue SystemExit => ex
|
34
36
|
puts Kontena.pastel.red('[Command exited with error]') unless ex.status.zero?
|
35
37
|
rescue => ex
|
36
38
|
puts Kontena.pastel.red("ERROR: #{ex.message}")
|
39
|
+
ensure
|
40
|
+
Thread.main['spinners'] && Thread.main['spinners'].map(&:kill) && Thread.main['spinners'] = nil
|
37
41
|
end
|
38
42
|
|
39
43
|
def subcommand_class
|
@@ -38,7 +38,7 @@ module Kontena::Plugin
|
|
38
38
|
def run
|
39
39
|
puts File.read(__FILE__)[/__END__$(.*)/m, 1]
|
40
40
|
puts "Kontena Shell v#{Kontena::Plugin::Shell::VERSION} (c) 2017 Kontena"
|
41
|
-
puts pastel.
|
41
|
+
puts pastel.green("Enter 'help' to see a list of commands or 'help <command>' to get help on a specific command.")
|
42
42
|
|
43
43
|
stty_save = `stty -g`.chomp rescue nil
|
44
44
|
at_exit do
|
@@ -100,11 +100,11 @@ module Kontena::Plugin
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def master_name
|
103
|
-
config.current_master ? pastel.
|
103
|
+
config.current_master ? pastel.blue(config.current_master.name) : pastel.red('<no master>')
|
104
104
|
end
|
105
105
|
|
106
106
|
def grid_name
|
107
|
-
config.current_grid ? pastel.
|
107
|
+
config.current_grid ? pastel.blue(config.current_grid) : pastel.red('<no grid>')
|
108
108
|
end
|
109
109
|
end
|
110
110
|
end
|
data/lib/kontena_cli_plugin.rb
CHANGED
@@ -5,6 +5,6 @@ $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
|
|
5
5
|
require 'kontena_cli' unless Object.const_defined?(:Kontena) && Kontena.const_defined?(:Cli)
|
6
6
|
|
7
7
|
require 'kontena/plugin/shell'
|
8
|
-
require 'kontena/
|
8
|
+
require 'kontena/cli/subcommand_loader'
|
9
9
|
|
10
|
-
Kontena::MainCommand.register("shell", "Kontena shell", Kontena::
|
10
|
+
Kontena::MainCommand.register("shell", "Kontena shell", Kontena::Cli::SubcommandLoader.new('kontena/plugin/shell/shell_command'))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kontena-plugin-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kontena, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kontena-cli
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
131
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.
|
132
|
+
rubygems_version: 2.6.13
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Kontena interactive shell plugin
|