mirror of
https://github.com/pragma-/pbot.git
synced 2026-05-24 00:03:18 +02:00
applets/unicode.pl: improve search option
This commit is contained in:
parent
6292e49d02
commit
bfe252b5c5
12
applets/unicode.pl
vendored
12
applets/unicode.pl
vendored
@ -45,7 +45,17 @@ my $result;
|
|||||||
if ($args =~ /^u\+/i) {
|
if ($args =~ /^u\+/i) {
|
||||||
$result = `unicode --max=100 --color=off -- \Q$args\E`;
|
$result = `unicode --max=100 --color=off -- \Q$args\E`;
|
||||||
} elsif ($search) {
|
} 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 {
|
} 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`;
|
$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`;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,8 +25,8 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4938,
|
BUILD_REVISION => 4939,
|
||||||
BUILD_DATE => "2026-02-19",
|
BUILD_DATE => "2026-02-27",
|
||||||
};
|
};
|
||||||
|
|
||||||
sub initialize {}
|
sub initialize {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user