DEVTOOLS: Added stdin encoding mode for dumper-companion.pl

This commit is contained in:
Eugene Sandulenko 2021-07-27 23:28:49 +02:00
parent 57836da5bb
commit b1d37306f9
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -40,7 +40,7 @@ sub decode_punycode;
sub encode_punycode;
sub encode_punycodefilename;
getopts('hmf:c:ed');
getopts('hmf:c:eds');
if ($::opt_c and $::opt_e) {
die "$0: -c and -e are mutually exclusive";
@ -51,6 +51,14 @@ if ($::opt_h) {
exit 0;
}
if ($::opt_s) {
local $/;
my $input = <>;
print encode_punycodefilename($input) . "\n";
exit 0;
}
if ($::opt_m) {
processMacbinary;
exit 0;
@ -180,6 +188,10 @@ Mode 2:
Optionally specify encoding (MacRoman, MacJapanese)
If -e is specified, then encode filenames into punycode
Mode 3:
$0 -s
Read whole standard input and encode it with punycode
Miscellaneous:
-h, --help display this help and exit
EOF