X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=bin%2Fmco;fp=bin%2Fmco;h=dd692fc2253668e16713d6210dd7e82a83b72198;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/bin/mco b/bin/mco new file mode 100755 index 0000000..dd692fc --- /dev/null +++ b/bin/mco @@ -0,0 +1,37 @@ +#!/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\-([a-zA-Z\-_\.]+)$/ + 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 "usage: #{$0} command " + puts + puts "Known commands:" + puts + + known_applications.sort.uniq.in_groups_of(3) do |apps| + puts " %-20s %-20s %-20s" % [apps[0], apps[1], apps[2]] + end + + puts + puts "Type '#{$0} help' for a detailed list of commands and '#{$0} help command'" + puts "to get detailed help for a command" + puts +end