mhonarc-commits
[Top] [All Lists]

CVS: mharc/lib/MHArc Util.pm,1.1,1.2

2002-07-06 21:10:49
Update of /cvsroot/mhonarc/mharc/lib/MHArc
In directory subversions:/tmp/cvs-serv15337

Modified Files:
	Util.pm 
Log Message:
* Added usage() routine (moved from web-archive program).


Index: Util.pm
===================================================================
RCS file: /cvsroot/mhonarc/mharc/lib/MHArc/Util.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Util.pm	6 Mar 2002 18:14:23 -0000	1.1
--- Util.pm	7 Jul 2002 04:09:35 -0000	1.2
***************
*** 33,36 ****
--- 33,37 ----
    &mk_dir
    &run_prg
+   &usage
  );
  
***************
*** 81,84 ****
--- 82,98 ----
  }
  
+ sub usage {
+   require Pod::Usage;
+   my $verbose = shift;
+   if ($verbose == 0) {
+     Pod::Usage::pod2usage(-verbose => $verbose);
+   } else {
+     my $pager = $ENV{'PAGER'} || 'more';
+     local(*PAGER);
+     my $fh = (-t STDOUT && open(PAGER, "|$pager")) ? \*PAGER : \*STDOUT;
+     Pod::Usage::pod2usage(-verbose => $verbose,
+ 			  -output  => $fh);
+   }
+ }
  
  ##--------------------------------------------------------------------------##
***************
*** 155,166 ****
  a non-zero status.
  
  =back
  
  =head1 VERSION
  
! C<$Id>
  
  =head1 AUTHOR
  
  Earl Hood, earl(_at_)earlhood(_dot_)com
  
--- 169,193 ----
  a non-zero status.
  
+ =item C<usage($verbosity)>
+ 
+ Display usage information of program based upon embedded POD.
+ The C<$verbosity> argument has the same meaning as the C<-verbose>
+ option to C<Pod::Usage::pod2usage>.
+ 
  =back
  
  =head1 VERSION
  
! C<$Id$>
  
  =head1 AUTHOR
  
  Earl Hood, earl(_at_)earlhood(_dot_)com
+ 
+ This module is part of the MHArc archiving system and comes with
+ ABSOLUTELY NO WARRANTY and may be copied only under the terms of
+ the GNU General Public License, which may be found in the MHArc
+ distribution.
+ 
+ =cut
  

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV