XMLTV::Options
Command-line parsing for XMLTV grabbers
- Provided by: libxmltv-perl (Version: 0.5.67-0.1)
- Source: xmltv
- Report a bug
Command-line parsing for XMLTV grabbers
Utility library that implements command-line parsing and handles a lot of functionality that is common to all XMLTV grabbers.
All these functions are exported on demand.
my( $opt, $conf ) = ParseOptions( {
grabber_name => 'tv_grab_test',
version => '$Id: Options.pm,v 1.29 2015/07/12 00:59:01 knowledgejunkie Exp $',
description => 'Sweden (tv.swedb.se)',
capabilities => [qw/baseline manualconfig apiconfig lineups/],
stage_sub => \&config_stage,
listchannels_sub => \&list_channels,
list_lineups_sub => \&list_lineups,
get_lineup_sub => \&get_lineup,
} );
ParseOptions returns two hashrefs:
ParseOptions handles the following options automatically without returning:
ParseOptions also takes care of the following options without returning, by calling the stage_sub, listchannels_sub, list_lineups_sub and get_lineup_sub callbacks supplied by the grabber:
ParseOptions will thus only return to the grabber when the grabber shall actually grab data.
If the --output option is specified, STDOUT will be redirected to the specified file.
The grabber must check the following options on its own:
and any other options that are grabber specific. This can be done by reading $opt->{days} etc.
capabilities => [qw/baseline manualconfig apiconfig/],
Note that XMLTV::Options guarantees that the grabber supports the manualconfig and apiconfig capabilities. The capabilities share and cache can be specified if the grabber supports them. XMLTV::Options will then automatically accept the command-line parameters --share and --cache respectively.
my( $opt, $conf ) = ParseOptions( {
grabber_name => 'tv_grab_test',
version => '$Id: Options.pm,v 1.29 2015/07/12 00:59:01 knowledgejunkie Exp $',
description => 'Sweden (tv.swedb.se)',
capabilities => [qw/baseline manualconfig apiconfig preferredmethod/],
stage_sub => \&config_stage,
listchannels_sub => \&list_channels,
preferredmethod => 'allatonce',
list_lineups_sub => \&list_lineups,
get_lineup_sub => \&get_lineup,
} );
Copyright (C) 2005,2006 Mattias Holmlund.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.