From 1e5f60acb4bf4e202770ee033974c72685693a67 Mon Sep 17 00:00:00 2001 From: linggao Date: Thu, 10 Apr 2008 21:06:26 +0000 Subject: [PATCH] worked on the usage logic for rinv,rspconfig etc.commands git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1019 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/Usage.pm | 51 +++++++++++++++++++++++ xCAT-client-2.0/pods/man1/rspconfig.1.pod | 28 ++++++++++--- xCAT-server-2.0/lib/xcat/plugins/blade.pm | 23 ++++------ xCAT-server-2.0/lib/xcat/plugins/ipmi.pm | 17 +++----- 4 files changed, 87 insertions(+), 32 deletions(-) create mode 100644 perl-xCAT-2.0/xCAT/Usage.pm diff --git a/perl-xCAT-2.0/xCAT/Usage.pm b/perl-xCAT-2.0/xCAT/Usage.pm new file mode 100644 index 000000000..00d208e74 --- /dev/null +++ b/perl-xCAT-2.0/xCAT/Usage.pm @@ -0,0 +1,51 @@ +#!/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"; } +} diff --git a/xCAT-client-2.0/pods/man1/rspconfig.1.pod b/xCAT-client-2.0/pods/man1/rspconfig.1.pod index 55c076b7c..649212761 100644 --- a/xCAT-client-2.0/pods/man1/rspconfig.1.pod +++ b/xCAT-client-2.0/pods/man1/rspconfig.1.pod @@ -4,9 +4,7 @@ B - remote power control of nodes =head1 SYNOPSIS -B I {B|B|B|B} - -B I {B|B|B|B} +B I {B|B|B} B I B={B|B|B|B} @@ -14,10 +12,22 @@ B I B=I B I B={B|I} -B I B=I