New module: Scriptalicious
Hi all, I've decided that instead of helping the Perl world by single-handedly spearheading one of the most ambitious tasks to ever hit CPAN, I'm going to help contribute to its gradual decline by releasing yet another reinvented wheel. Muhahaha! Didn't see that coming, did you? The program listed in the manual page displays the following when run with `-h' : pu - an uncarved block of wood Usage: pu [options] arguments This script's function is to be a blank example that many great and simple scripts may be built upon. Remember, you cannot carve rotten wood. Command line options: -h, --helpDisplay a program usage screen and exit. -V, --version Display program version and exit. -v, --verbose Verbose command execution, displaying things like the commands run, their output, etc. -q, --quiet Suppress all normal program output; only display errors and warnings. -d, --debug Display output to help someone debug this script, not the process going on. See `perldoc t/pu.pl' for more information. Here is the man page for Scriptalicious: NAME Scriptalicious - Delicious scripting goodies SYNOPSIS use Scriptalicious -progname = pu, -version = $VERSION; my $url = .; getopt(u|url = \$url); run(echo, doing something with $url); my $output = capture(svn, info, $url); __END__ =head1 NAME pu - an uncarved block of wood =head1 SYNOPSIS pu [options] arguments =head1 DESCRIPTION This script's function is to be a blank example that many great and simple scripts may be built upon. Remember, you cannot carve rotten wood. =head1 COMMAND LINE OPTIONS =over =item B-h, --help Display a program usage screen and exit. =item B-V, --version Display program version and exit. =item B-v, --verbose Verbose command execution, displaying things like the commands run, their output, etc. =item B-q, --quiet Suppress all normal program output; only display errors and warnings. =item B-d, --debug Display output to help someone debug this script, not the process going on. =back DESCRIPTION This module helps you write scripts, quickly. Just include the above as a template. Unfortunately, it is not possible to have a `use' dependency automatically add structure to your POD yet, so you have to include the above manually. To avoid all that unnecessary explicit importing of symbols, the fol- lowing symbols and functions are exported into the caller's namespace: getopt(@getopt_args) This just calls Getopt::Long::GetOptions (see Getopt::Long for details). It automatically adds to the arguments you give it some standard command line options. $VERBOSE Set to 0 by default, and 1 if -v or --verbose was found during the call to getopt(). Extra -v's or --debug will push this variable higher. If -q or --quiet is specified, this will be less than one. $PROGNAME It is recommended that you only ever read this variable, and pass it in via the import. This is not automatically extracted from the POD for performance reasons. getopt(@getopt_args) Fetch arguments via Getopt::Long::GetOptions. The bundling option is enabled by default - which differs from the standard con- figuration of Getopt::Long. To alter the configuration, simply call Getopt::Long::config. See Getopt::Long for more informa- tion. say something Prints a message to standard output, unless quiet mode (-q or --quiet) was specified. For normal program messages. mutter progress Prints a message to standard output, if verbose mode (-v) or debug mode (-d) is enabled (ie, if $VERBOSE 0). For messages designed to help a user of the script to see more information about what is going on. whisper detail Prints a message to standard output, if debug mode (-d) is enabled or multiple verbose options were passed (ie, if $VERBOSE 1). For messages designed to help a person debugging the script to see more information about what is going on internally to the script. abort won't go to sea in a storm Prints a short program usage message (extracted from the POD synop- sis) and exits with an error code. moan weather is miserable Prints a warning to standard error. It is preceded with the text warning:. The program does not exit. barf hit an iceberg Prints a warning to standard error. It is preceded with
RE: New module: Scriptalicious
You may or may not care to peruse the underdocumented Getopt::Plus, which has similar aims to scriptalicious, but quite a different approach. Mx. -Original Message- From: Sam Vilain [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 7:57 AM To: [EMAIL PROTECTED] Subject: New module: Scriptalicious Hi all, I've decided that instead of helping the Perl world by single-handedly spearheading one of the most ambitious tasks to ever hit CPAN, I'm going to help contribute to its gradual decline by releasing yet another reinvented wheel. Muhahaha! Didn't see that coming, did you? The program listed in the manual page displays the following when run with `-h' : pu - an uncarved block of wood Usage: pu [options] arguments This script's function is to be a blank example that many great and simple scripts may be built upon. Remember, you cannot carve rotten wood. Command line options: -h, --helpDisplay a program usage screen and exit. -V, --version Display program version and exit. -v, --verbose Verbose command execution, displaying things like the commands run, their output, etc. -q, --quiet Suppress all normal program output; only display errors and warnings. -d, --debug Display output to help someone debug this script, not the process going on. See `perldoc t/pu.pl' for more information. Here is the man page for Scriptalicious: NAME Scriptalicious - Delicious scripting goodies SYNOPSIS use Scriptalicious -progname = pu, -version = $VERSION; my $url = .; getopt(u|url = \$url); run(echo, doing something with $url); my $output = capture(svn, info, $url); __END__ =head1 NAME pu - an uncarved block of wood =head1 SYNOPSIS pu [options] arguments =head1 DESCRIPTION This script's function is to be a blank example that many great and simple scripts may be built upon. Remember, you cannot carve rotten wood. =head1 COMMAND LINE OPTIONS =over =item B-h, --help Display a program usage screen and exit. =item B-V, --version Display program version and exit. =item B-v, --verbose Verbose command execution, displaying things like the commands run, their output, etc. =item B-q, --quiet Suppress all normal program output; only display errors and warnings. =item B-d, --debug Display output to help someone debug this script, not the process going on. =back DESCRIPTION This module helps you write scripts, quickly. Just include the above as a template. Unfortunately, it is not possible to have a `use' dependency automatically add structure to your POD yet, so you have to include the above manually. To avoid all that unnecessary explicit importing of symbols, the fol- lowing symbols and functions are exported into the caller's namespace: getopt(@getopt_args) This just calls Getopt::Long::GetOptions (see Getopt::Long for details). It automatically adds to the arguments you give it some standard command line options. $VERBOSE Set to 0 by default, and 1 if -v or --verbose was found during the call to getopt(). Extra -v's or --debug will push this variable higher. If -q or --quiet is specified, this will be less than one. $PROGNAME It is recommended that you only ever read this variable, and pass it in via the import. This is not automatically extracted from the POD for performance reasons. getopt(@getopt_args) Fetch arguments via Getopt::Long::GetOptions. The bundling option is enabled by default - which differs from the standard con- figuration of Getopt::Long. To alter the configuration, simply call Getopt::Long::config. See Getopt::Long for more informa- tion. say something Prints a message to standard output, unless quiet mode (-q or --quiet) was specified. For normal program messages. mutter progress Prints a message to standard output, if verbose mode (-v) or debug mode (-d) is enabled (ie, if $VERBOSE 0). For messages designed to help a user of the script to see more information about what is going on. whisper detail Prints a message to standard output, if debug mode (-d) is enabled or multiple verbose options were passed (ie, if $VERBOSE 1). For messages designed to help a person debugging the script to see more information about what is going on internally to the
Re: New module: Scriptalicious
[Quoting Pearce, Martyn, on April 8 2004, 09:11, in RE: New module: Scri] getopt(@getopt_args) This just calls Getopt::Long::GetOptions (see Getopt::Long for details). It automatically adds to the arguments you give it some standard command line options. Please be informed that Getopt::Long, as of 2.34, automatically provides --verbose and --help options. -- Johan
RE: New module: Scriptalicious
Er, I think you're quoting Sam rather than me there. Mx. -Original Message- From: Johan Vromans [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 10:36 AM To: Pearce, Martyn Cc: 'Sam Vilain'; '[EMAIL PROTECTED]' Subject: Re: New module: Scriptalicious [Quoting Pearce, Martyn, on April 8 2004, 09:11, in RE: New module: Scri] getopt(@getopt_args) This just calls Getopt::Long::GetOptions (see Getopt::Long for details). It automatically adds to the arguments you give it some standard command line options. Please be informed that Getopt::Long, as of 2.34, automatically provides --verbose and --help options. -- Johan
Re: running tests
On Apr 2, 2004, at 4:59 PM, Andy Lester wrote: Sure, but even better is to run only the tests that need to be run, which is a key part of prove. You can run prove -Mblib t/mytest.t instead of the entire make test suite. When I'm using Module::Build, I do this: Build test --test_files t/mytest.t And actually, I have a shell alias set up so it just becomes: t t/mytest.t -Ken
Re: New module: Scriptalicious
Martyn == Martyn Pearce [EMAIL PROTECTED] writes: Martyn Er, I think you're quoting Sam rather than me there. He's quoting you, quoting Sam. So the quote was accurate! We can count chevrons. We're cool. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/ Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!