Integrate mainline
[p5sagit/p5-mst-13.2.git] / ext / Encode / bin / piconv
index 9c7cf32..10cfb5e 100644 (file)
@@ -1,5 +1,5 @@
 #!./perl
-# $Id: piconv,v 1.10 2002/03/31 21:00:50 dankogai Exp $
+# $Id: piconv,v 1.20 2002/04/04 19:50:52 dankogai Exp $
 #
 use 5.7.3;
 use strict;
@@ -9,9 +9,11 @@ my %Scheme =  map {$_ => 1} qw(from_to decode_encode perlio);
 
 use Getopt::Std;
 
-my %Opt; getopts("DS:lf:t:s:", \%Opt);
+my %Opt; getopts("hDS:lf:t:s:", \%Opt);
+$Opt{h} and help();
 $Opt{l} and list_encodings();
 my $locale = $ENV{LC_CTYPE} || $ENV{LC_ALL} || $ENV{LANG};
+$Opt{f} || $Opt{t} || help();
 my $from = $Opt{f} || $locale or help("from_encoding unspecified");
 my $to   = $Opt{t} || $locale or help("to_encoding unspecified");
 $Opt{s} and Encode::from_to($Opt{s}, $from, $to) and print $Opt{s} and exit;
@@ -112,8 +114,11 @@ uses I<string> instead of file for the source of text.  Same as F<iconv>.
 
 =item -l
 
-Lists all available encodings to STDERR.  This feature is missing from
-F<iconv>.
+Lists all available encodings to STDERR.
+
+=item -h
+
+Show usage.
 
 =item -D