summaryrefslogtreecommitdiffstats
path: root/lib/Reply/Plugin.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-10 02:23:13 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-10 02:23:13 -0400
commitd30b4d66828b31823af1885d48a07825b4b570ee (patch)
treeca6dbbc004348ed47259a9e32c67c6179cb2baad /lib/Reply/Plugin.pm
parent99202371c7784d346cf43a4c25c64bb6d7630f10 (diff)
downloadreply-d30b4d66828b31823af1885d48a07825b4b570ee.tar.gz
reply-d30b4d66828b31823af1885d48a07825b4b570ee.zip
autocomplete for commands (fixes #18)
Diffstat (limited to 'lib/Reply/Plugin.pm')
-rw-r--r--lib/Reply/Plugin.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Reply/Plugin.pm b/lib/Reply/Plugin.pm
index ed3efbb..f17b135 100644
--- a/lib/Reply/Plugin.pm
+++ b/lib/Reply/Plugin.pm
@@ -3,6 +3,8 @@ use strict;
use warnings;
# ABSTRACT: base class for Reply plugins
+use Reply::Util 'methods';
+
=head1 SYNOPSIS
package Reply::Plugin::Foo;
@@ -183,6 +185,12 @@ sub publish {
$self->{publisher}->(@_);
}
+sub commands {
+ my $self = shift;
+
+ return map { s/^command_//; $_ } grep { /^command_/ } methods($self);
+}
+
=for Pod::Coverage
new