Improve M$ Windows compatibility
[spider.git] / cmd / show / wx.pl
1 #
2 # show wx data
3 #
4 my $self = shift;
5
6 # this appears to be a reasonable thing for users to do (thank you JE1SGH)
7 # return (1, $self->msg('e5')) if $self->priv < 9;
8
9 my $cmdline = shift;
10 my @f = split /\s+/, $cmdline;
11 my $f;
12 my @out;
13 my ($from, $to); 
14
15 $from = 0;
16 while ($f = shift @f) {                 # next field
17         #  print "f: $f list: ", join(',', @list), "\n";
18         if (!$from && !$to) {
19                 ($from, $to) = $f =~ /^(\d+)-(\d+)$/o;         # is it a from -> to count?
20                 next if $from && $to > $from;
21         }
22         if (!$to) {
23                 ($to) = $f =~ /^(\d+)$/o if !$to;              # is it a to count?
24                 next if $to;
25         }
26 }
27
28 $to = 20 unless $to;
29 $from = 0 unless $from;
30
31 if ($self->{_nospawn} || $main::is_win == 1) {
32         @out = $self->spawn_cmd("show/wx $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'ann', 'WX']);
33 } else {
34         @out = DXLog::print($from, $to, $main::systime, 'ann', 'WX');
35 }
36         
37 return (1, @out);