File: Description.pm

package info (click to toggle)
xmltv 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,396 kB
  • sloc: perl: 37,189; xml: 5,017; sh: 153; makefile: 18
file content (26 lines) | stat: -rw-r--r-- 499 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Add a --description argument to your program, eg
#
# use XMLTV::Description "Sweden (tv.swedb.se)";
#

package XMLTV::Description;

my $opt = '--description';
sub import( $$ ) {
    die "usage: use $_[0] \"Sweden (tv.swedb.se)" if @_ != 2;
    my $seen = 0;
    foreach (@ARGV) {
	# This doesn't handle abbreviations in the GNU style.
	last if $_ eq '--';
	if ($_ eq $opt) {
	    $seen++ && warn "seen '$opt' twice\n";
	}
    }
    return if not $seen;

    print $_[1] . "\n";

    exit();
}

1;