File: Capabilities.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 (29 lines) | stat: -rw-r--r-- 540 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
27
28
29
# Add a --capabilities argument to your program, eg
#
# use XMLTV::Version qw/baseline manualconfig/;
#

package XMLTV::Capabilities;

my $opt = '--capabilities';
sub import( $$ ) {
    die "usage: use $_[0] qw/<capabilities>/" 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;

    eval {
	print join "\n", @_[1..$#_];
        print "\n";
    };

    exit();
}

1;