| 1 |
Getopt::Tabular |
| 2 |
version 0.2 |
| 3 |
19 June, 1997 |
| 4 |
|
| 5 |
Copyright (c) 1995-97 Greg Ward. All rights reserved. This is free |
| 6 |
software; you can redistribute it and/or modify it under the same terms as |
| 7 |
Perl itself. |
| 8 |
|
| 9 |
Getopt::Tabular is a Perl 5 module for table-driven argument parsing, |
| 10 |
vaguely inspired by John Ousterhout's Tk_ParseArgv. See Tabular.pod for |
| 11 |
details. It is available from |
| 12 |
|
| 13 |
ftp://ftp.bic.mni.mcgill.ca/users/greg |
| 14 |
|
| 15 |
and should be available through CPAN at |
| 16 |
|
| 17 |
http://www.perl.com/CPAN/authors/id/GWARD |
| 18 |
|
| 19 |
|
| 20 |
Some nice features of Getopt::Tabular are: |
| 21 |
|
| 22 |
* Command-line arguments are carefully type-checked, both by pattern and |
| 23 |
number---e.g. if an option requires two integers, GetOptions makes sure |
| 24 |
that exactly two integers follow it! |
| 25 |
|
| 26 |
* The valid command-line arguments are specified in a data structure |
| 27 |
separate from the call to GetOptions; this makes it easier to have very |
| 28 |
long lists of options, and to parse options from multiple sources |
| 29 |
(e.g. the command line, an environment variable, and a configuration |
| 30 |
file). |
| 31 |
|
| 32 |
* Getopt::Tabular can intelligently generate help text based on your option |
| 33 |
descriptions. |
| 34 |
|
| 35 |
* The type system is extensible, and if you can define your desired |
| 36 |
argument type using a single Perl regular expression then it's |
| 37 |
particularly easy to extend. |
| 38 |
|
| 39 |
* Options can be abbreviated and come in any order. |
| 40 |
|
| 41 |
* A "spoof" mode in which arguments are parsed without side-effects. |
| 42 |
|
| 43 |
To test and install Getopt::Tabular: |
| 44 |
|
| 45 |
perl ./Makefile.PL |
| 46 |
make test |
| 47 |
make install |
| 48 |
|
| 49 |
That's it! The test suite isn't very complete yet, but it's a start. The |
| 50 |
documentation is quite extensive; only a few minor features aren't covered. |
| 51 |
Also, there is a demo program that shows off several of the module's |
| 52 |
features. |
| 53 |
|
| 54 |
Email problems, questions, bug reports, etc. to [email protected]. |