From 5acd1be649672f6e5bd2b4a6772b51cd935ebda9 Mon Sep 17 00:00:00 2001 From: djk Date: Tue, 25 May 1999 13:21:40 +0000 Subject: [PATCH] added who command --- Changes | 1 + cmd/Aliases | 3 ++- cmd/who.pl | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 cmd/who.pl diff --git a/Changes b/Changes index 4b6cefaa..9ea91d1a 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,7 @@ 2. got rid of the stupid bug that failed to print out the offline message but put a "*main::STDOUTmain" for every line of that message instead. 3. Ported to 5.00503 (well actually just installed it and it just runs). +4. Added who command 23May99======================================================================= 1. Got rid of some of the useless error messages on global destruction when quiting a program. diff --git a/cmd/Aliases b/cmd/Aliases index 3aaddb28..9c5094e4 100644 --- a/cmd/Aliases +++ b/cmd/Aliases @@ -36,7 +36,7 @@ package CmdAlias; ], 'd' => [ '^del', 'kill', 'kill', - '^del.*/fu', 'kill full', 'kill', + '^del\w*/fu', 'kill full', 'kill', '^di\w*/a\w*', 'directory all', 'directory', '^di\w*/b\w*', 'directory bulletins', 'directory', '^di\w*/n\w*', 'directory new', 'directory', @@ -91,6 +91,7 @@ package CmdAlias; '^set/noww', 'unset/wwv', 'unset/wwv', '^set/nowx', 'unset/wx', 'unset/wx', '^sh$', 'show', 'show', + '^sh\w*/bu', 'show/files bulletins', 'show/files', '^sh\w*/c/n', 'show/configuration nodes', 'show/configuration', '^sh\w*/c$', 'show/configuration', 'show/configuration', '^sh\w*/dx/(\d+)-(\d+)', 'show/dx $1-$2', 'show/dx', diff --git a/cmd/who.pl b/cmd/who.pl new file mode 100644 index 00000000..34e2d0a4 --- /dev/null +++ b/cmd/who.pl @@ -0,0 +1,24 @@ +# +# who : is online +# a complete list of stations connected +# +# Copyright (c) 1999 Dirk Koopman G1TLH +# +# $Id$ + + +my $self = shift; +my $dxchan; +my @out; + +push @out, " Callsign Type Started Name"; + +foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) { + my $call = $dxchan->call(); + my $t = cldatetime($dxchan->user->lastin); + my $sort = $dxchan->is_ak1a() ? "NODE" : "USER"; + my $name = $dxchan->user->name; + push @out, sprintf "%10s $sort $t $name", $call; +} + +return (1, @out) -- 2.43.0