Getopt::Long::Spec::Builder - Build a Getopt::Long option spec from a set of attributes
version 0.002
This module builds a Getopt::Long option specification from a hash of option parameters as would be returned by Getopt::Long::Spec::Parser->parse($spec) and/or Getopt::Nearly::Everything->opt($opt_name)->attrs().
Here's an example of use:
use Getopt::Long::Spec::Builder; my %opt_attrs = ( opt_type => 'simple' value_required => 1, value_type => 'string', max_vals => '5', dest_type => 'array', min_vals => '1', short => [ 'f' ], long => 'foo', ); my $builder = Getopt::Long::Spec::Builder->new(); my $spec = $builder->build( %opt_attrs ); print $spec; # output: 'foo|f=s@{1,5}' # OR... my $spec = Getopt::Long::Spec::Builder->build( %opt_attrs );
Create a new builder object.
Build a Getopt::Long option specification from the attributes passed in and return the spec as a string
Getopt::Long - info on option specifications
Getopt::Long::Spec - parse and build GoL specifications
Getopt::Long::Spec::Parser - parse GoL specifications
Getopt::Nearly::Everything - the module for which this module was created
Stephen R. Scaffidi <sscaffidi@cpan.org>
This software is copyright (c) 2012 by Stephen R. Scaffidi.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Getopt::Long::Spec, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Getopt::Long::Spec
CPAN shell
perl -MCPAN -e shell install Getopt::Long::Spec
For more information on module installation, please visit the detailed CPAN module installation guide.