diff --git a/xCAT-server/share/xcat/tools/mktoolscenter b/xCAT-server/share/xcat/tools/mktoolscenter index 65f93e22b..61752ce68 100755 --- a/xCAT-server/share/xcat/tools/mktoolscenter +++ b/xCAT-server/share/xcat/tools/mktoolscenter @@ -33,6 +33,7 @@ my %Options = ('interactive',"yes",'warnings','','log',"yes",'dump',"yes"); my @warnings; my $logfile = DEFAULT_LOG_FILE; my $now = localtime; +my $help; # # print a warning and wait a bit if warnings are enabled @@ -136,6 +137,23 @@ sub question { return $reply; } +sub usage { + print "Usage: mktoolscenter\n"; + print " --ph \n"; + print " --pp \n"; + print " --puser \n"; + print " --ppw \n"; + print " -l \n"; + print " -s\n"; + print " --nfsserver \n"; + print " --nfspath \n"; + print " --profilename \n"; + print " --help\n\n"; + print "Updates IBM system x server hardware using IBM Bootable Media Creator.\n\n"; + print "Author: Jim Turner\n"; +} + + # # Begin main # @@ -147,21 +165,14 @@ unless (GetOptions("s"=>\$surrogate, "l=s"=>\$logfile, "ph=s"=>\$proxy{host}, "pp=i"=>\$proxy{port}, "puser=s"=>\$proxy{user}, "ppw=s"=>\$proxy{pw}, "nfsserver=s"=>\$nfsserver,"nfspath=s"=>\$nfspath, - "profilename=s"=>\$profilename, + "profilename=s"=>\$profilename, "help"=>\$help, )) { - printf "Usage:\n"; - printf "--ph \n"; - printf "--pp \n"; - printf "--puser \n"; - printf "--ppw \n"; - printf "-l \n"; - printf "-s\n"; - printf "--nfsserver \n"; - printf "--nfspath \n"; - printf "--profilename \n"; + usage(); exit(1); } +if ($help) { usage(); exit 0; } + if (@ARGV > 0) { open(IN,"<",@ARGV[0]) || die "Cannot open input file @ARGV[0]"; $Options{interactive} = '';