Added proper POD documentation to utility scripts using POD::Usage.

This commit is contained in:
Ernesto Hernández-Novich 2008-06-06 22:08:59 +00:00
parent 3a59968376
commit 4555e8ca8e
15 changed files with 1202 additions and 604 deletions

View file

@ -17,6 +17,7 @@ BEGIN {
}
use Getopt::Long;
use Pod::Usage;
use strict;
use WebGUI::Session;
@ -32,30 +33,58 @@ GetOptions(
'configFile=s'=>\$configFile
);
if ($help || $configFile eq ""){
print <<STOP;
pod2usage( verbose => 2 ) if $help;
pod2usage() if $configFile eq "";
Usage: perl $0
Options:
--help Display this help message and exit.
--configFile The config file for the site.
--start Turn on maintenance mode (default).
--stop Turn off maintenance mode.
STOP
exit;
}
my $session = WebGUI::Session->open($webguiRoot,$configFile);
$session->setting->remove('specialState');
$session->setting->add('specialState','upgrading') unless $stop;
$session->var->end;
$session->close;
__END__
=head1 NAME
maintenanceMode - Set WebGUI site into maintenance mode.
=head1 SYNOPSIS
maintenanceMode --configFile config.conf [--start|--stop]
maintenanceMode --help
=head1 DESCRIPTION
This utility script will set or unset WebGUI's C<specialState>
setting to signal the beginning or end of Maintenance Mode.
=over
=item C<--configFile config.conf>
The WebGUI config file to use. Only the file name needs to be specified,
since it will be looked up inside WebGUI's configuration directory.
This parameter is required.
=item C<--start>
Set C<specialState> to signal the beginning of maintenance mode.
This is the default behaviour.
=item C<--stop>
Unset C<specialState> to signal the end of maintenance mode.
=item C<--help>
Shows this documentation, then exits.
=back
=head1 AUTHOR
Copyright 2001-2008 Plain Black Corporation.
=cut