3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

modules/trans.pl: use -no-ansi instead of regex

This commit is contained in:
Pragmatic Software 2021-01-19 02:23:10 -08:00
parent ba769dc446
commit f426594d80

5
modules/trans.pl vendored
View File

@ -14,11 +14,8 @@ my $args = quotemeta "@ARGV";
$args =~ s/\\([ :-])/$1/g; $args =~ s/\\([ :-])/$1/g;
$args =~ s/^\s+|\s+$//g; $args =~ s/^\s+|\s+$//g;
my $opts = '-j'; my $opts = '-j -no-ansi -no-autocorrect';
$opts .= ' -b' unless $args =~ /^-/; $opts .= ' -b' unless $args =~ /^-/;
my $result = `trans $opts $args`; my $result = `trans $opts $args`;
$result =~ s/\e\[\d+m//g;
print "$result\n"; print "$result\n";