diff options
author | varac <varacanero@zeromail.org> | 2016-02-21 22:13:31 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-02-23 14:09:53 +0100 |
commit | 7435240de98f9d3822b5f30224d39aa8588adb7e (patch) | |
tree | 6bd234dc7275d15ab0d51487f0662a520dc40708 /lib/leap_cli | |
parent | 7c12520c65f4efc6342a77eb208772c1be006286 (diff) |
[feat] 'leap history --last' shows only last entry
Diffstat (limited to 'lib/leap_cli')
-rw-r--r-- | lib/leap_cli/commands/deploy.rb | 17 |
1 files changed, 12 insertions, 5 deletions
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 |