forked from choria-legacy/marionette-collective
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mco
executable file
·27 lines (22 loc) · 643 Bytes
/
mco
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env ruby
require 'mcollective'
Version = MCollective.version
known_applications = MCollective::Applications.list
# links from mc-ping to mc will result in ping being run
if $0 =~ /mc\-(.+)$/
app_name = $1
else
app_name = ARGV.first
ARGV.delete_at(0)
end
if known_applications.include?(app_name)
# make sure the various options classes shows the right help etc
$0 = app_name
MCollective::Applications.run(app_name)
else
puts "The Marionette Collective version #{MCollective.version}"
puts
puts "#{$0}: command (options)"
puts
puts "Known commands: #{known_applications.join " "}"
end