: # use perl                                  -*- mode: Perl; -*-
        eval 'exec perl -S $0 "$@"'
                if $runnning_under_some_shell;

# find contact person for application
# -- bjoerns@acm.org 1995-12-13

$st='uwarobot';
$prefix='/store';

unshift( @INC, "$prefix/etc/internal" ) ;

require "getopt.pl" ;

require "lib/conffile.pl" ;
require "lib/config.pl" ;
require "lib/genarchs.pl" ;
require "lib/output.pl" ;
require "lib/regist.pl" ;

&'readgenarchs ;
&'readconffile("$config") ;

$'debug = $'WARNINGS ;

# Setup finished


#do Getopt('elri');	# email, login name, real name, or initials
$_ = $ARGV[0];

$extract_re='^(\S+)'		if (/^-i$/);
$extract_re='-\s*(.+)\s+<'	if (/^-r$/);
$extract_re='<([^@>]+)'		if (/^-l$/);
$extract_re='<([^>]+)'		if (/^-e$/);

if (defined($extract_re)) {
	shift(@ARGV);
} else {
	$extract_re='(.*)';
}

foreach $app (@ARGV) {
	&'readregist($st, $app)	|| die "readregist: $!";
	if ($'regist{'version'}) {
		local($sig) = $'regist{'signature'};
		print "$app: "	if (@ARGV > 1);
		($_) = ($sig =~ m/$extract_re/);
		print "$_\n";
	} else {
		warn "$app: no such application";
	}
}
