develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #117649] [PATCH] Refer to documentation on find2perl switch error

Thread Next
From:
James E Keenan via RT
Date:
May 9, 2013 01:45
Subject:
[perl #117649] [PATCH] Refer to documentation on find2perl switch error
Message ID:
rt-3.6.HEAD-6955-1368063906-1346.117649-15-0@perl.org
On Wed Apr 17 06:21:08 2013, ppisar wrote:
> ---
>  x2p/find2perl.PL | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/x2p/find2perl.PL b/x2p/find2perl.PL
> index e9275d0..3803699 100644
> --- a/x2p/find2perl.PL
> +++ b/x2p/find2perl.PL
> @@ -70,7 +70,8 @@ my $print_needed = 1;
>  
>  while (@ARGV) {
>      $_ = shift;
> -    s/^-// || /^[()!]/ || die "Unrecognized switch: $_\n";
> +    s/^-// || /^[()!]/ || die "Unrecognized switch: $_\n",
> +        "See manual or perldoc page for usage help.\n";
>      if ($_ eq '(') {
>          $out .= tab . "(\n";
>          $indent_depth++;
> @@ -236,7 +237,8 @@ while (@ARGV) {
>                       qq{) || die "Can't open $fh: \$!\\n";\n};
>          $init{cpio} = 1;
>      } else {
> -        die "Unrecognized switch: -$_\n";
> +        die "Unrecognized switch: -$_\n",
> +            "See manual or perldoc page for usage help.\n";
>      }
>  
>      if (@ARGV) {

I agree that the two current error messages are rather ... skimpy.

But I'm not sure that you're suggestion of adding on "See manual or
perldoc page for usage help" adds much.  Most of the time, when I see a
'die' in code, I expect something like this:

#####
die "Unrecognized switch: -$_: $!
#####

What do other people think?

Thank you very much.
Jim Keenan


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=117649

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About