From: Jarkko Hietaniemi Date: Sun, 31 Mar 2002 23:18:51 +0000 (+0000) Subject: Slight usage tweaks to piconv: show usage with X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d31fa6c480b5ee26e249b176d8f8e3249c620f80;p=p5sagit%2Fp5-mst-13.2.git Slight usage tweaks to piconv: show usage with no -t -f or -l arguments, or with -h. p4raw-id: //depot/perl@15641 --- diff --git a/ext/Encode/bin/piconv b/ext/Encode/bin/piconv index 9c7cf32..cdf3ee2 100644 --- a/ext/Encode/bin/piconv +++ b/ext/Encode/bin/piconv @@ -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; @@ -115,6 +117,10 @@ uses I instead of file for the source of text. Same as F. Lists all available encodings to STDERR. This feature is missing from F. +=item -h + +Show usage. + =item -D Invokes debugging mode. Primarily for Encode hackers.