add stats

This commit is contained in:
espie 2017-11-28 13:17:49 +00:00
parent e0c842248a
commit 7ad3b2301c

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: External.pm,v 1.6 2017/11/28 13:13:22 espie Exp $
# $OpenBSD: External.pm,v 1.7 2017/11/28 13:17:49 espie Exp $
#
# Copyright (c) 2017 Marc Espie <espie@openbsd.org>
#
@ -61,12 +61,15 @@ sub handle_command
} elsif ($line =~ m/^addhost\s+(.*)/) {
my @list = split(/\s+/, $1);
DPB::Config->add_host($self->{state}, @list);
} elsif ($line =~ m/^stats\b/) {
$fh->print($self->{state}->engine->statline, "\n");
} elsif ($line =~ m/^help\b/) {
$fh->print(
"Commands:\n",
"\taddhost <hostline>\n",
"\tbye\n",
"\tdontclean <pkgpath>\n"
"\tdontclean <pkgpath>\n",
"\tstats\n"
);
} else {
$fh->print("Unknown command: ", $line, " (help for details)\n");