develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [PATCH] h2xs

Thread Previous | Thread Next
From:
Jonathan Stowe
Date:
July 8, 2001 04:24
Subject:
Re: [PATCH] h2xs
Message ID:
Pine.LNX.4.33.0107081223300.5330-100000@orpheus.gellyfish.com
On Sat, 7 Jul 2001, Hugo van der Sanden wrote:

> Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> :On Fri, 6 Jul 2001, Nicholas Clark wrote:
> :>
> :> I'd like to add a switch to make the generated AUTOLOAD function not fall
> :> back to AutoLoader, but I can't work out which letter to use.
> :>
> :>  B DE GHIJKL N  QRSTUV XYZ
> :>     e g ij l    qr  u w yz
> :>
> :> are free, but none seem that suitable for "no AutoLoader;"
> :> [I didn't think N was great, as "no" is lowercase.]
> :>
> :
> :I wanted to add a switch to omit the Exporter stuff and had the same
> :problem .
>
> Time to go for --longoption style, perhaps?
>

Something like this perhaps :

--- utils/h2xs.PL~	Sun Jul  8 12:20:20 2001
+++ utils/h2xs.PL	Sun Jul  8 12:20:53 2001
@@ -422,7 +422,7 @@
 my @ARGS = @ARGV;
 my $compat_version = $];

-use Getopt::Std;
+use Getopt::Long;
 use Config;
 use Text::Wrap;
 $Text::Wrap::huge = 'overflow';
@@ -462,11 +462,38 @@
 EOFUSAGE
 }

-
-getopts("ACF:M:OPXacdfhkmn:o:p:s:v:xb:t:") || usage;
 use vars qw($opt_A $opt_C $opt_F $opt_M $opt_O $opt_P $opt_X $opt_a $opt_c
             $opt_d $opt_f $opt_h $opt_k $opt_m $opt_n $opt_o $opt_p $opt_s
             $opt_v $opt_x $opt_b $opt_t);
+
+Getopt::Long::Configure('bundling');
+
+my %options = (
+                'omit_autoload|A+'   => \$opt_A,
+                'omit_changes|C+'    => \$opt_C,
+                'cpp_flags|F=s'      => \$opt_F,
+                'func_mask|M=s'      => \$opt_M,
+                'overwrite_ok|O+'    => \$opt_O,
+                'omit_pod|P+'        => \$opt_P,
+                'omit_XS|X+'         => \$opt_X,
+                'gen_accessors|a+'   => \$opt_a,
+                'compat_version|b=s' => \$opt_b,
+                'omit_constant|c+'   => \$opt_c,
+                'debugging|d+'       => \$opt_d,
+                'force|f+'           => \$opt_f,
+                'help|h|?+'          => \$opt_h,
+                'omit_const_func|k+' => \$opt_k,
+                'gen_tied_var|m+'    => \$opt_m,
+                'name|n=s'           => \$opt_n,
+                'opaque_re|o=s'      => \$opt_o,
+                'remove_prefix|p=s'  => \$opt_p,
+                'const_subs|s=s'     => \$opt_s,
+                'default_type|t=s'   => \$opt_t,
+                'version|v=s'        => \$opt_v,
+                'autogen_xsubs|x=s'  => \$opt_x
+              );
+
+GetOptions(%options) || usage;

 usage if $opt_h;



I'll change the POD and usage  if there are no malcontents :)

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


Thread Previous | 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