3 # Originally by Simon Tatham
4 # Modified by Richard Kettlewell, Colin Watson, Ian Jackson
9 ($verbose='STDERR', shift @ARGV) if $ARGV[0] eq "-v";
11 my $c = cnntp_connect($verbose);
16 # some servers require a GROUP before an ARTICLE command
17 $c->docmd("GROUP misc.misc");
26 my $item = shift @ARGV;
27 if($item !~ /[\@:]/ and not defined $group) {
28 # maybe a bare group followed by an article number
30 my $number = shift @ARGV;
31 $item = "$item $number";
43 if($mid !~ /\@/ and $mid =~ /^(.*)[: ](\d+)$/) {
44 my ($g, $n) = ($1, $2);
45 $c->docmd("GROUP $g");
46 $c->docmd("ARTICLE $n");
50 $c->docmd("ARTICLE <$mid>");
55 my $lesscmd= $ENV{'NNTPID_PAGER'};
56 $lesscmd= 'less' unless defined $lesscmd;
57 open LESS, "|-", 'sh','-c',$lesscmd or die $!;
62 ($code,$_) = $c->getline();
69 if ($fh ne 'STDOUT') {
70 close $fh or die "$? $!";