Improve M$ Windows compatibility
[spider.git] / cmd / show / rcmd.pl
1 #
2 # print out the general log file for rcmds only
3 #
4 # Copyright (c) 1998 - Dirk Koopman G1TLH
5 #
6 #
7 #
8 my $self = shift;
9
10 return (1, $self->msg('e5')) if $self->priv < 9;
11
12 my $cmdline = shift;
13 my @f = split /\s+/, $cmdline;
14 my $f;
15 my @out;
16 my ($from, $to, $who); 
17
18 $from = 0;
19 while ($f = shift @f) {                 # next field
20         #  print "f: $f list: ", join(',', @list), "\n";
21         if (!$from && !$to) {
22                 ($from, $to) = $f =~ /^(\d+)-(\d+)$/o;         # is it a from -> to count?
23                 next if $from && $to > $from;
24         }
25         if (!$to) {
26                 ($to) = $f =~ /^(\d+)$/o if !$to;              # is it a to count?
27                 next if $to;
28         }
29         next if $who;
30         if ($f !~ /^\d+$/) {
31                 ($who) = $f;
32         }
33 }
34
35 $to = 20 unless $to;
36 $from = 0 unless $from;
37
38 return (1, DXLog::print($from, $to, $main::systime, 'rcmd', $who)) if ($self->{_nospawn} || $main::is_win == 1);
39 return (1, $self->spawn_cmd("show/rcmd $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'rcmd', $who]));
40