bin/tl in testlab-0.4.16 vs bin/tl in testlab-0.5.0
- old
+ new
@@ -339,21 +339,26 @@
# CONTAINER SSH
################
c.desc 'Open an SSH console to a container'
c.command :ssh do |ssh|
- ssh.desc 'Username'
+ ssh.desc 'Specify an SSH Username to use'
ssh.arg_name 'username'
ssh.flag [:u, :user]
+ ssh.desc 'Specify an SSH Identity Key to use'
+ ssh.arg_name 'key'
+ ssh.flag [:k, :key]
+
ssh.action do |global_options, options, args|
help_now!('id is required') if options[:id].nil?
container = @testlab.containers.select{ |n| n.id.to_sym == options[:id].to_sym }.first
container.nil? and raise TestLab::TestLabError, "We could not find the container you supplied!"
ssh_options = Hash.new
ssh_options[:user] = options[:user]
+ ssh_options[:keys] = options[:key]
container.ssh(ssh_options).console
end
end