Options:
--help, -h print usage information
--version, -V print version information
- --file, -l <file> changelog file to parse, defaults
- to 'debian/changelog'
+ --label, -l <file> name of the changelog file to
+ use in error messages
+ --file <file> changelog file to parse, defaults
+ to '-' (standard input)
--format <outputformat> see man page for list of available
output formats, defaults to 'dpkg'
for compatibility with dpkg-dev
"), $progname;
}
-my ( $since, $until, $from, $to, $all, $count, $offset, $file );
-my $default_file = 'debian/changelog';
+my ( $since, $until, $from, $to, $all, $count, $offset, $file, $label );
+my $default_file = '-';
my $format = 'dpkg';
my %allowed_formats = (
dpkg => 1,
$format = $val;
}
-GetOptions( "file|l=s" => \$file,
+GetOptions( "file=s" => \$file,
+ "label|l=s" => \$label,
"since|v=s" => \$since,
"until|u=s" => \$until,
"from|f=s" => \$from,
my $changes = Dpkg::Changelog::Debian->init();
$file ||= $default_file;
+$label ||= $file;
unless ($since or $until or $from or $to or
$offset or $count or $all) {
$count = 1;
my $opts = { since => $since, until => $until,
from => $from, to => $to,
count => $count, offset => $offset,
- @all };
+ @all, reportfile => $label };
if ($file eq '-') {
- my @input = <STDIN>;
- $changes->parse({ instring => join('', @input), %$opts })
+ $changes->parse({ inhandle => \*STDIN, %$opts })
or failure(_g('fatal error occured while parsing input'));
} else {
$changes->parse({ infile => $file, %$opts })