diff options
author | 2008-01-31 18:00:19 +0000 | |
---|---|---|
committer | 2008-01-31 18:00:19 +0000 | |
commit | cc3c680689ffee987399fbad306acfd23399995a (patch) | |
tree | bfc972d7f65f0ee732e414462fc338666b18cf21 | |
parent | Bug 414726: Bugzilla::Update never updates bugzilla-update.xml if the file al... (diff) | |
download | bugzilla-cc3c680689ffee987399fbad306acfd23399995a.tar.gz bugzilla-cc3c680689ffee987399fbad306acfd23399995a.tar.bz2 bugzilla-cc3c680689ffee987399fbad306acfd23399995a.zip |
Bug 413163: sanitycheck.pl needs to be more helpful when run at command line - Patch by Colin Ogilvie <colin.ogilvie@gmail.com> r/a=LpSolit
-rw-r--r-- | docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm | 3 | ||||
-rw-r--r-- | sanitycheck.pl | 48 |
2 files changed, 49 insertions, 2 deletions
diff --git a/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm b/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm index 339a55be9..c0a70fa57 100644 --- a/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm +++ b/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm @@ -31,7 +31,8 @@ BEGIN { *esc = \&Pod::Simple::HTML::esc } # Note that if you leave out a category here, it will not be indexed # in the contents file, even though its HTML POD will still exist. use constant FILE_TRANSLATION => { - Files => ['importxml', 'contrib', 'checksetup', 'email_in', 'install-module'], + Files => ['importxml', 'contrib', 'checksetup', 'email_in', 'install-module', + 'sanitycheck'], Modules => ['bugzilla'], Extensions => ['extensions'], }; diff --git a/sanitycheck.pl b/sanitycheck.pl index 5f158cb3b..2ef0eea7d 100644 --- a/sanitycheck.pl +++ b/sanitycheck.pl @@ -30,11 +30,17 @@ use Bugzilla::User; use Bugzilla::Mailer; use Getopt::Long; +use Pod::Usage; my $verbose = 0; # Return all comments if true, else errors only. my $login = ''; # Login name of the user which is used to call sanitycheck.cgi. +my $help = 0; # Has user asked for help on this script? -my $result = GetOptions('verbose' => \$verbose, 'login=s' => \$login); +my $result = GetOptions('verbose' => \$verbose, + 'login=s' => \$login, + 'help|h|?' => \$help); + +pod2usage({-verbose => 1, -exitval => 1}) if $help; Bugzilla->usage_mode(USAGE_MODE_CMDLINE); @@ -68,3 +74,43 @@ if ($cgi->param('output')) { MessageToMTA($message); } + + +__END__ + +=head1 NAME + +sanitycheck.pl - Perl script to perform a sanity check at the command line + +=head1 SYNOPSIS + + ./sanitycheck.pl [--help] + ./sanitycheck.pl [--verbose] --login <user@domain.com> + +=head1 OPTIONS + +=over + +=item B<--help> + +Displays this help text + +=item B<--verbose> + +Causes this script to be more verbose in its output. Without this option, +the script will return only errors. With the option, the script will append +all output to the email. + +=item B<--login> + +This should be passed the email address of a user that is capable of +running the Sanity Check process, a user with the editcomponents priv. This +user will receive an email with the results of the script run. + +=back + +=head1 DESCRIPTION + +This script provides a way of running a 'Sanity Check' on the database +via either a CLI or cron. It is equivalent to calling sanitycheck.cgi +via a web broswer. |