summaryrefslogtreecommitdiffstats
path: root/lib/ASM
diff options
context:
space:
mode:
authorLibravatarDoug Freed <dwfreed@mtu.edu>2016-07-14 06:55:00 -0700
committerLibravatarDoug Freed <dwfreed@mtu.edu>2016-07-14 07:07:28 -0700
commit4382169e60b212ef0541bcf83cc9886c6fa34a8b (patch)
treecedd82e9fd15ede74a8efc9bd401de6b93ed9a49 /lib/ASM
parent473ba634a02c159eda2a56ad15b53a38c2024984 (diff)
Add a version command.
*NOTE*: Reflects the state of git only at the time the bot is started. Version is not updated in any way at runtime. First field is the newest commit that exists both locally and on GitLab. Second field is the output of `git describe --all --long --dirty`. Third field is the latest commit locally.
Diffstat (limited to 'lib/ASM')
-rw-r--r--lib/ASM/Commander.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ASM/Commander.pm b/lib/ASM/Commander.pm
index e91dc44..f37aaf0 100644
--- a/lib/ASM/Commander.pm
+++ b/lib/ASM/Commander.pm
@@ -149,6 +149,8 @@ my $cmdtbl = {
'^;explain (?<nick1>\S+)\s+(?<nick2>\S+)\s*$' => {
'flag' => 's',
'cmd' => \&cmd_explain },
+ '^;version$' => {
+ 'cmd' => \&cmd_version },
};
sub new {
@@ -1101,4 +1103,9 @@ sub cmd_explain { # all hosts associated with two given nicks
$conn->privmsg($event->replyto, $header . ASM::Util->commaAndify(sort @$result));
}
+sub cmd_version {
+ my ($conn, $event) = @_;
+ $conn->privmsg($event->replyto, $::version);
+}
+
# vim: ts=8:sts=8:sw=8:noexpandtab