From f3ef5ce546a468611ed7fe1a5e11be419ebc50f7 Mon Sep 17 00:00:00 2001 From: lissav Date: Fri, 30 Apr 2010 13:25:58 +0000 Subject: [PATCH] add verbose mode git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5927 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/sbin/dumpxCATdb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xCAT-client/sbin/dumpxCATdb b/xCAT-client/sbin/dumpxCATdb index 2488d8cef..e4444190d 100644 --- a/xCAT-client/sbin/dumpxCATdb +++ b/xCAT-client/sbin/dumpxCATdb @@ -47,6 +47,10 @@ foreach my $table (@output) if ($::RUNCMD_RC != 0) { # error xCAT::MsgUtils->message("E", "Error running $cmd, @errout\n"); + } else { + if ($::DUMPVERBOSE) { + xCAT::MsgUtils->message("I", "Dumping $table\n"); + } } } @@ -64,7 +68,8 @@ exit $rc; sub parse_args { my $msg; - my $usagemsg; + my $usagemsg = + " dumpxCATdb -h \n dumpxCATdb -v \n dumpxCATdb [-V] [-p] [path to dump directory]\n"; Getopt::Long::Configure("posix_default"); Getopt::Long::Configure("no_gnu_compat"); Getopt::Long::Configure("bundling"); @@ -72,20 +77,17 @@ sub parse_args !GetOptions( 'p|path=s' => \$::PATH, 'h|help' => \$::HELP, + 'V|verbose' => \$::DUMPVERBOSE, 'v|version' => \$::VERSION ) ) { - $usagemsg = - " dumpxCATdb -h \n dumpxCATdb -v \n dumpxCATdb [-p] [path to dump directory]\n"; xCAT::MsgUtils->message("E", $usagemsg); exit 1; } if ($::HELP) { - $usagemsg = - " dumpxCATdb -h \n dumpxCATdb -v \n dumpxCATdb [-p] [path to dump directory]\n"; xCAT::MsgUtils->message("I", $usagemsg); exit 0; }