diff options
author | David Phillips <david@sighup.nz> | 2018-09-07 23:27:40 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-09-07 23:27:40 +1200 |
commit | ad2319935c1494cf2e67e75575fc3a743356672b (patch) | |
tree | 465d3170712c0ad959a95c062d5004785ce02ad5 | |
parent | 105ea0350a8b65fe80044c1ba15e85c86688bab3 (diff) | |
download | idalius-ad2319935c1494cf2e67e75575fc3a743356672b.tar.xz |
Make commands case insensitive
-rwxr-xr-x | idalius.pl | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } } |