oldest one is lost for every one added above 20).
4. Added generalised shell globbing everywhere I think it is useful, including
sh/dx, dir
-5. Made dir more friendly and give more info, you can do > < and a number now.
+5. Made dir more compatible with ak1a and added 'to' and 'from' call searching
+it should now do everything that ak1a does except counts.
22May99=======================================================================
1. added check for -1 from Date::Parse and return undef for out of range dates
2. added show/files and type commands
'^di\w*/n\w*', 'directory new', 'directory',
'^di\w*/o\w*', 'directory own', 'directory',
'^di\w*/s\w*', 'directory subject', 'directory',
+ '^di\w*/t\w*', 'directory to', 'directory',
+ '^di\w*/f\w*', 'directory from', 'directory',
'^di\w*/(\d+)-(\d+)', 'directory $1-$2', 'directory',
'^di\w*/(\d+)', 'directory $1', 'directory',
],
=== 0^DIRECTORY^List messages
=== 0^DIRECTORY ALL^List all messages
=== 0^DIRECTORY OWN^List your own messages
-=== 0^DIRECTORY NEW^List your own new messages
-List the messages in the messages directory.
+=== 0^DIRECTORY NEW^List all new messages
+=== 0^DIRECTORY TO <call>^List all messages to <call>
+=== 0^DIRECTORY FROM <call>^List all messages from <call>
+=== 0^DIRECTORY SUBJECT <string>^List all messages with <string> in subject
+=== 0^DIRECTORY <nn>^List last <nn> messages
+=== 0^DIRECTORY <from>-<to>^List messages <from> message <to> message
+List the messages in the messages directory.
If there is a 'p' one space after the message number then it is a
-personal message.
+personal message. If there is a '-' between the message number and the
+'p' then this indicates that the message has been read.
-If there is a - after the message number then this indicates that the
-message has been read.
+You can use shell escape characters such as '*' and '?' in the <call>
+fields.
+
+You can combine some of the various directory commands together eg:-
+
+ DIR TO G1TLH 5
+or
+ DIR SUBJECT IOTA 200-250
+
+You can abbreviate all the commands to one letter and use ak1a syntax:-
+
+ DIR/T G1* 10
+ DIR/S QSL 10-100 5
=== 5^DIRECTORY-^
Sysops can see all users' messages.
SH/DXCC G
SH/DXCC W on 20m info iota
-=== 0^SHOW/FILES [<filearea>]^List the contents of a filearea
+=== 0^SHOW/FILES [<filearea> [<string>]]^List the contents of a filearea
SHOW/FILES on its own will show you a list of the various fileareas
available on the system. To see the contents of a particular file
area type:-
where <filearea> is the name of the filearea you want to see the
contents of.
+You can also use shell globbing characters like '*' and '?' in a
+string to see a selection of files in a filearea eg:-
+ SH/FILES bulletins arld*
+
See also TYPE - to see the contents of a file.
=== 0^SHOW/PREFIX <callsign>^Interrogate the prefix database
my $ref;
my @out;
my $f;
-my $n = 10;
-
-if (!@f) {
- my @all = (DXMsg::get_all());
- my ($i, $count);
- for ($i = $#all; $i > 0; $i--) {
- $ref = $all[$i];
- next if $self->priv < 5 && $ref->private && $ref->to ne $self->call && $ref->from ne $self->call;
- unshift @ref, $ref;
- last if ++$count >= $n;
- }
-}
+my $n = 0;
+my @all = grep {!($self->priv < 5 && $_->private && $_->to ne $self->call && $_->from ne $self->call)} (DXMsg::get_all());
+my $sel = 0;
+my $from = 0;
+my $to = $all[@all-1]->msgno;
while (@f) {
$f = uc shift @f;
if ($f eq 'ALL') {
- foreach $ref (DXMsg::get_all()) {
- next if $self->priv < 5 && $ref->private && $ref->to ne $self->call && $ref->from ne $self->call;
- push @ref, $ref;
- }
- last;
+ @ref = @all;
+ $n = @ref;
+ $sel++;
} elsif ($f =~ /^O/o) { # dir/own
- foreach $ref (DXMsg::get_all()) {
- push @ref, $ref if $ref->private && ($ref->to eq $self->call || $ref->from eq $self->call);
- }
+ @ref = grep { $_->to eq $self->call || $_->from eq $self->call } @all;
+ $sel++;
} elsif ($f =~ /^N/o) { # dir/new
- foreach $ref (DXMsg::get_all()) {
- push @ref, $ref if $ref->private && !$ref->read && $ref->to eq $self->call;
+ @ref = grep { $_->t > $self->user->lastin } @all;
+ $sel++;
+ } elsif ($f =~ /^S/o) { # dir/subject
+ $f = shift @f;
+ if ($f) {
+ $f =~ s{(.)}{"\Q$1"}ge;
+ @ref = grep { $_->subject =~ m{$f}i } @all;
+ $sel++;
}
- } elsif ($f eq '>' || $f eq 'TO'){
+ } elsif ($f eq '>' || $f =~ /^T/o){
$f = uc shift @f;
if ($f) {
$f = shellregex($f);
- foreach $ref (DXMsg::get_all()) {
- next if $self->priv < 5 && $ref->private && $ref->to ne $self->call && $ref->from ne $self->call;
- next unless $ref->to =~ m{$f};
- push @ref, $ref;
- }
+ @ref = grep { $_->to =~ m{$f} } @all;
+ $sel++;
}
- } elsif ($f eq '<' || $f eq 'FROM'){
+ } elsif ($f eq '<' || $f =~ /^F/o){
$f = uc shift @f;
if ($f) {
$f = shellregex($f);
- foreach $ref (DXMsg::get_all()) {
- next if $self->priv < 5 && $ref->private && $ref->to ne $self->call && $ref->from ne $self->call;
- next unless $ref->from =~ m{$f};
- push @ref, $ref;
- }
+ @ref = grep { $_->from =~ m{$f} } @all;
+ $sel++;
}
+ } elsif ($f =~ /^(\d+)-(\d+)$/) { # a range of items
+ $from = $1;
+ $to = $2;
} elsif ($f =~ /^\d+$/ && $f > 0) { # a number of items
$n = $f;
}
}
+$n = 10 unless $n;
+@ref = @all unless $sel || @ref;
+
if (@ref) {
+ if ($from != 0 || $to != $all[@all-1]->msgno) {
+ @ref = grep {$_->msgno >= $from && $_->msgno <= $to} @ref;
+ }
my $i = @ref - $n;
$i = 0 unless $i > 0;
my $count;
# any info
if ($info) {
$expr .= " && " if $expr;
- $info = shellregex($info);
+ $info =~ s{(.)}{"\Q$1"}ge;
$expr .= "\$f3 =~ m{$info}io";
}
die "trying to create a duplicate channel for $call" if $channels{$call};
$self->{call} = $call;
+ $self->{priv} = 0;
$self->{conn} = $conn if defined $conn; # if this isn't defined then it must be a list
if (defined $user) {
$self->{user} = $user;