3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-04 18:38:47 +02:00

FactoidCommands: quote arugments only if necessary

This commit is contained in:
Pragmatic Software 2019-06-22 18:30:40 -07:00
parent 5cf13c1bdd
commit 1e15848442

View File

@ -363,7 +363,7 @@ sub factundo {
return $usage if @$args > 2;
return $usage if not @$args;
$arguments = join(' ', map { $_ = "'$_'" } @$args);
$arguments = join(' ', map { $_ = "'$_'" if $_ =~ m/ /; $_; } @$args);
my $arglist = $self->{pbot}->{interpreter}->make_args($arguments);
my ($channel, $trigger) = $self->find_factoid_with_optional_channel($from, $arguments, 'factundo', explicit => 1, exact_channel => 1);
@ -463,7 +463,7 @@ sub factredo {
return $usage if @$args > 2;
return $usage if not @$args;
$arguments = join(' ', map { $_ = "'$_'" } @$args);
$arguments = join(' ', map { $_ = "'$_'" if $_ =~ m/ /; $_; } @$args);
my ($channel, $trigger) = $self->find_factoid_with_optional_channel($from, $arguments, 'factredo', explicit => 1, exact_channel => 1);
return $channel if not defined $trigger; # if $trigger is not defined, $channel is an error message
@ -1154,7 +1154,7 @@ sub factlog {
return "Too many arguments -- $usage" if @$args > 2;
return "Missing argument -- $usage" if not @$args;
$args = join(' ', map { $_ = "'$_'" } @$args);
$args = join(' ', map { $_ = "'$_'" if $_ =~ m/ /; $_; } @$args);
my ($channel, $trigger) = $self->find_factoid_with_optional_channel($from, $args, 'factlog', usage => $usage, exact_channel => 1);