diff --git a/devtools/dumper-companion.pl b/devtools/dumper-companion.pl index 6ac3031ed98..ed72235bcce 100644 --- a/devtools/dumper-companion.pl +++ b/devtools/dumper-companion.pl @@ -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