#!/usr/bin/perl # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html package xCAT::Usage; #------------------------------------------------------------------------------- =head1 xCAT::Usage =head2 Package Description xCAT usage module. Some commands such as rpower have different implementations for different hardware. This module holds the usage usage string for these kind of commands so that the usage can be referenced from different modules. =cut #------------------------------------------------------------------------------- my %usage = ( "rpower" => "Usage: rpower [--nodeps][on|off|reset|stat|boot]", "rbeacon" => "Usage: rbeacon [on|off|stat]", "rvitals" => "Usage: rvitals [all|temp|wattage|voltage|fanspeed|power|leds]", "reventlog" => "Usage: reventlog [all|clear|]", "rinv" => "Usage: rinv [all|model|serial|vpd|mprom|deviceid|uuid]", "rsetboot" => "Usage: rsetboot [net|hd|cd|def|stat]", "rbootseq" => "Usage: rbootseq [hd0|hd1|hd2|hd3|net|iscsi|usbflash|floppy|none],...", "rscan" => "Usage: rscan [-w][-x|-z]", "rspconfig" => "Usage: Common: rspconfig [snmpdest|alert|community] rspconfig [snmpdest=|alert=|community=] BMC specific: rspconfig [ip|netmask|gateway|backupgateway|garp] rspconfig [garp=] MPA specific: rspconfig [sshcfg|snmpcfg|build] rspconfig [shcfg=|snmpcfg=]" ); #-------------------------------------------------------------------------------- =head3 getUsage It returns the usage string for the given command. Arguments: command Returns: the usage string for the command. =cut #------------------------------------------------------------------------------- sub getUsage { my ($class, $command)=@_; if (exists($usage{$command})) { return $usage{$command};} else { return "Usage for command $command cannot be found\n"; } }