Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

Commit

Permalink
add mco shell kill subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
richardc committed May 30, 2014
1 parent 0613176 commit 43375ec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/mcollective/application/shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class MCollective::Application::Shell < MCollective::Application
mco shell start [COMMAND]
mco shell watch [HANDLE]
mco shell tail [COMMAND]
mco shell list
mco shell kill [HANDLE]
END_OF_USAGE

def post_option_parser(configuration)
Expand Down Expand Up @@ -149,6 +151,15 @@ def tail_command
watch_these(client, processes, true)
end

def kill_command
handle = ARGV.shift
client = rpcclient('shell')

client.kill(:handle => handle)

printrpcstats :summarize => true, :caption => "Command list"
end

def watch_these(client, processes, kill_on_interrupt = false)
client.progress = false

Expand Down

0 comments on commit 43375ec

Please sign in to comment.