From 7435240de98f9d3822b5f30224d39aa8588adb7e Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 21 Feb 2016 22:13:31 +0100 Subject: [feat] 'leap history --last' shows only last entry --- lib/leap_cli/commands/deploy.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'lib/leap_cli') diff --git a/lib/leap_cli/commands/deploy.rb b/lib/leap_cli/commands/deploy.rb index 29c3faf5..9dd190ab 100644 --- a/lib/leap_cli/commands/deploy.rb +++ b/lib/leap_cli/commands/deploy.rb @@ -87,14 +87,21 @@ module LeapCli long_desc 'The FILTER can be the name of a node, service, or tag.' arg_name 'FILTER' command [:history, :h] do |c| - c.flag :port, :desc => 'Override the default SSH port.', - :arg_name => 'PORT' - c.flag :ip, :desc => 'Override the default SSH IP address.', - :arg_name => 'IPADDRESS' + c.flag :port, :desc => 'Override the default SSH port.', + :arg_name => 'PORT' + c.flag :ip, :desc => 'Override the default SSH IP address.', + :arg_name => 'IPADDRESS' + c.switch :last, :desc => 'Show last deploy only', + :negatable => false c.action do |global,options,args| + if options[:last] == true + lines = 1 + else + lines = 10 + end nodes = manager.filter!(args) ssh_connect(nodes, connect_options(options)) do |ssh| - ssh.leap.history + ssh.leap.history(lines) end end end -- cgit v1.2.3