xmltv/grab/uk_atlas tv_grab_uk_atlas,1.6,1.7

Geoff <[email protected]>
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/grab/uk_atlas
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10395

Modified Files:
	tv_grab_uk_atlas 
Log Message:
redefine Options::PrintUsage so we can tell people about our 'extra_options'

Index: tv_grab_uk_atlas
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/uk_atlas/tv_grab_uk_atlas,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** tv_grab_uk_atlas	23 Oct 2013 16:26:41 -0000	1.6
--- tv_grab_uk_atlas	26 Nov 2013 14:20:17 -0000	1.7
***************
*** 59,65 ****
  
  
  # ------------------------------------------------------------------------------------------------------------------------------------- #
  # Use XMLTV::Options::ParseOptions to parse the options and take care of the basic capabilities that a tv_grabber should
! my ($opt, $conf) = ParseOptions({ 
  			grabber_name 			=> $GRABBER_NAME,
  			capabilities 			=> [qw/baseline manualconfig apiconfig cache/],
--- 59,77 ----
  
  
+ # Options.pm hi-jacks the --help arg and creates its own POD synopsis!  This means we can't tell people about our added
+ #  parameters.  I would posit that's a bug.  Let's redefine the PrintUsage to our POD.
+ my ($opt, $conf);
+ {
+ 	no warnings 'redefine';
+ 	local *XMLTV::Options::PrintUsage = sub {  
+ 		use Pod::Usage;
+ 		pod2usage(-verbose => 0);
+ 		#exit 1;
+ 	};
+ 	use warnings 'redefine';
+ 	
  # ------------------------------------------------------------------------------------------------------------------------------------- #
  # Use XMLTV::Options::ParseOptions to parse the options and take care of the basic capabilities that a tv_grabber should
!  ($opt, $conf) = ParseOptions({ 
  			grabber_name 			=> $GRABBER_NAME,
  			capabilities 			=> [qw/baseline manualconfig apiconfig cache/],
***************
*** 71,78 ****
  			defaults					=> {'hours'=>0, 'channel'=>''}
  });
  #print Dumper($conf, $opt); exit;
  
! # options.pm hi-jacks the --help arg and creates its own POD synopsis!  This means we can't tell people about our added
! #  parameters.  I would posit that's a bug.  Let's allow '--info' to replace it.
  if ($opt->{'info'}) {
  	use Pod::Usage;
--- 83,90 ----
  			defaults					=> {'hours'=>0, 'channel'=>''}
  });
+ }
  #print Dumper($conf, $opt); exit;
  
! # --info option prints a 'man' style page from our POD.
  if ($opt->{'info'}) {
  	use Pod::Usage;
***************
*** 1209,1222 ****
  tv_grab_uk_atlas --description
  
! tv_grab_uk_atlas [--config-file FILE]
             [--days N] [--offset N] [--dst]
             [--output FILE] [--quiet] [--debug]
  
! tv_grab_uk_atlas [--config-file FILE]
             [--hours N] [--offset N]
             [--output FILE] [--quiet] [--debug]
  
! tv_grab_uk_atlas [--config-file FILE]
             [--date DATE] [--dst]
             [--output FILE] [--quiet] [--debug]
  
--- 1221,1237 ----
  tv_grab_uk_atlas --description
  
! tv_grab_uk_atlas 
             [--days N] [--offset N] [--dst]
+ 					 [--config-file FILE]
             [--output FILE] [--quiet] [--debug]
  
! tv_grab_uk_atlas 
             [--hours N] [--offset N]
+ 					 [--config-file FILE]
             [--output FILE] [--quiet] [--debug]
  
! tv_grab_uk_atlas 
             [--date DATE] [--dst]
+ 					 [--config-file FILE]
             [--output FILE] [--quiet] [--debug]
  
***************
*** 1282,1286 ****
  B<--help> Print a help message and exit.
  
! B<--info> Print this help page and exit.
  
  =head1 ERROR HANDLING
--- 1297,1301 ----
  B<--help> Print a help message and exit.
  
! B<--info> Print a help page and exit.
  
  =head1 ERROR HANDLING


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.