3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 11:42:35 +01:00

PBot: ignore leading hypen on registry command-line arguments too

This commit is contained in:
Pragmatic Software 2020-01-16 21:30:01 -08:00
parent bd11d501e3
commit 6f9133f982

View File

@ -166,6 +166,8 @@ sub initialize {
$self->{logger}->log("Fatal error: bad argument `$arg`; registry entries must be in the form of section.key (e.g.: irc.botnick)\n"); $self->{logger}->log("Fatal error: bad argument `$arg`; registry entries must be in the form of section.key (e.g.: irc.botnick)\n");
} }
$section =~ s/^-//; # remove a leading - to allow arguments like -irc.botnick due to habitual use of -args
$self->{logger}->log("Overriding $section.$key to $value\n"); $self->{logger}->log("Overriding $section.$key to $value\n");
$self->{registry}->set($section, $key, 'value', $value, 0, 1); $self->{registry}->set($section, $key, 'value', $value, 0, 1);
} }