3
0
mirror of https://github.com/pragma-/pbot.git synced 2026-02-28 04:07:55 +01:00

applets/unicode.pl: improve search option

This commit is contained in:
Pragmatic Software 2026-02-27 03:45:59 -08:00
parent 6292e49d02
commit bfe252b5c5
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 13 additions and 3 deletions

12
applets/unicode.pl vendored
View File

@ -45,7 +45,17 @@ my $result;
if ($args =~ /^u\+/i) {
$result = `unicode --max=100 --color=off -- \Q$args\E`;
} elsif ($search) {
$result = `unicode -r --max=100 --color=off -format 'U+{ordc:04X} {pchar} {name};\n' -- \Q$args\E`;
my @out = ();
if (open(CMD, "-|")) {
while (<CMD>) {
chomp;
push(@out, $_);
}
close CMD;
} else {
exec 'unicode', '-r', '--max=100', '--color=off', '--format', 'U+{ordc:04X} {pchar} {name};\n', '--', "\\b$args\\b";
}
$result = join "\n", @out;
} else {
$result = `unicode -s --max=100 --color=off --format 'U+{ordc:04X} ({utf8}) {pchar} {name} Category: {category} ({category_desc}) {opt_unicode_block}{opt_unicode_block_desc}{mirrored_desc}{opt_combining}{combining_desc}{opt_decomp}{decomp_desc};\n' -- \Q$args\E`;
}

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4938,
BUILD_DATE => "2026-02-19",
BUILD_REVISION => 4939,
BUILD_DATE => "2026-02-27",
};
sub initialize {}