aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-09-07 23:27:40 +1200
committerDavid Phillips <david@sighup.nz>2018-09-07 23:27:40 +1200
commitad2319935c1494cf2e67e75575fc3a743356672b (patch)
tree465d3170712c0ad959a95c062d5004785ce02ad5
parent105ea0350a8b65fe80044c1ba15e85c86688bab3 (diff)
downloadidalius-ad2319935c1494cf2e67e75575fc3a743356672b.tar.xz
Make commands case insensitive
-rwxr-xr-xidalius.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/idalius.pl b/idalius.pl
index d1cd12e..5f238a6 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -95,6 +95,7 @@ sub module_is_enabled {
# Register a command name to a certain sub
sub register_command {
my ($command, $action) = @_;
+ $command = lc $command;
log_info "Registering command: $command";
$commands{$command} = $action;
}
@@ -106,8 +107,8 @@ sub run_command {
my $command;
for my $c (keys %commands) {
- if (($command_verbatim) = $command_string =~ m/^(\Q$c\E( |$))/) {
- $command = $c;
+ if (($command_verbatim) = $command_string =~ m/^(\Q$c\E( |$))/i) {
+ $command = lc $c;
last;
}
}