Upgrade to Getopt::Long 2.28.
[p5sagit/p5-mst-13.2.git] / lib / Getopt / Long / CHANGES
1 Changes in version 2.28
2 -----------------------
3
4 * When an option is specified more than once, a warning is generated
5   if perl is run with -w. This is a correction to 2.27, where it would
6   unconditionally die.
7
8   An example of duplicate specification is GetOptions('foo', 'foo'),
9   but also GetOptions('foo=s', 'foo') and GetOptions('Foo', 'foo')
10   (the latter only when ignore_case is in effect).
11
12 Changes in version 2.27
13 -----------------------
14
15 * You can now specify integer options to take an optional argument.
16   that defaults to a specific value. E.g.,  GetOptions('foo:5' => \$var)
17   will allow $var to get the value 5 when no value was specified with
18   the -foo option on the command line.
19
20   Instead of a value, a '+' may be specified. E.g.,
21   GetOptions('foo:+' => \$var) will allow $var to be incremented when
22   no value was specified with the -foo option on the command line.
23
24 * Fix several problems with internal and external use of 'die' and
25   signal handlers.
26
27 * Fixed some bugs with subtle combinations of bundling_override and
28   ignore_case.
29
30 * A callback routine that is associated with a hash-valued option will
31   now have both the hask key and the value passed. It used to get only
32   the value passed.
33
34 * Eliminated the use of autoloading. Autoloading kept generating
35   problems during development, and when using perlcc.
36
37 * Avoid errors on references when an option is found in error, e.g.
38   GetOptions('fo$@#' => \$var).
39   Thanks to Wolfgang Laun <Wolfgang.Laun@alcatel.at>.
40
41 * When an option is specified more than once, an error is now
42   generated. E.g., GetOptions('foo', 'foo').
43   Thanks to Wolfgang Laun <Wolfgang.Laun@alcatel.at>.
44
45 * Lots of internal restructoring to make room for extensions.
46
47 * Redesigned the regression tests.
48
49 * Enhance the documentation to prevent common misunderstandings about
50   single character options.
51
52 Changes in version 2.26
53 -----------------------
54
55 * New option type: 'o'. It accepts all kinds of integral numbers in
56   Perl style, including decimal (24), octal (012), hexadecimal (0x2f)
57   and binary (0b1001).
58
59 * Fix problem with getopt_compat not matching +foo=bar.
60
61 * Remove $VERSION_STRING for production versions.
62
63 Changes in version 2.26
64 -----------------------
65
66 * New option type: 'o'. It accepts all kinds of integral numbers in
67   Perl style, including decimal (24), octal (012), hexadecimal (0x2f)
68   and binary (0b1001).
69
70 * Fix problem with getopt_compat not matching +foo=bar.
71
72 * Remove $VERSION_STRING for production versions.
73
74 Changes in version 2.25
75 -----------------------
76
77 * Change handling of a lone "-" on the command line. It will now be
78   treated as a non-option unless an explicit specification was passed
79   to GetOptions. See the manual.
80   In the old implementation an error was signalled, so no
81   compatibility breaks are expected from this change.
82
83 * Add $VERSION_STRING. This is the string form of $VERSION. Usually
84   they are identical, unless it is a pre-release in which case
85   $VERSION will be (e.g.) 2.2403 and $VERSION_STRING will be "2.24_03".
86
87 Changes in version 2.24
88 -----------------------
89
90 * Add object oriented interface:
91
92     use Getopt::Long;
93     $p = new Getopt::Long::Parser;
94     $p->configure(...configuration options...);
95     if ($p->getoptions(...options descriptions...)) ...
96
97 * Add configuration at 'use' time:
98
99     use Getopt::Long qw(:config no_ignore_case bundling);
100
101 * Add configuration options "gnu_getopt" and "gnu_compat".
102
103   "gnu_compat" controls whether --opt= is allowed, and what it should
104   do. Without "gnu_compat", --opt= gives an error. With "gnu_compat", 
105   --opt= will give option "opt" and empty value.
106   This is the way GNU getopt_long does it.
107
108   "gnu_getopt" is a short way of setting "gnu_compat bundling permute
109   no_getopt_compat. With "gnu_getopt", command line handling should be
110   fully compatible with GNU getopt_long.
111
112 * Correct warnings when the user specified an array or hash
113   destination using a non-lowercase option, e.g. "I=s@".
114
115 * Correct ambiguous use of 'set' and 'reset' in the Configuration
116   section of the documentation. 
117
118 * Add configuration option "posix_default" to reset to defaults as if
119   POSIXLY_CORRECT were set.
120
121 * Disallow "no" prefix on configuration options "default", "prefix" and
122   "prefix_pattern". 
123
124 * Add a section "Trouble Shooting" to the documentation, with
125   frequently asked questions.
126
127 Changes in version 2.23
128 -----------------------
129
130 * When a call-back routine issues 'die', messages starting with "!"
131   are treated specially. Currently, only "!FINISH" is recognised (see
132   the next bullet point). Other messages that start with "!" are
133   ignored.
134
135 * Change 'die("FINISH") (see changes in 2.21) to die("!FINISH"). This
136   is an incompatible change, but I guess noone is using this yet.
137
138 Changes in version 2.22
139 -----------------------
140
141 * Fixes a bug in the combination of aliases and negation.
142
143   Old:  "foo|bar!" allowed negation on foo, but not on bar.
144   New:  "foo|bar!" allows negation on foo and bar.
145
146   Caveat: "foo|f!", with bundling, issues the warning that negation on
147   a short option is ignored. To obtain the desired behaviour, use
148
149         "foo!" => \$opt_foo, "f" => \$opt_foo
150   or
151         "foo|f" => \$opt_foo, "nofoo" => sub { $opt_foo = 0 }
152
153   Remember that this is _only_ required when bundling is in effect.
154
155 Changes in version 2.21
156 -----------------------
157
158 * New documentation.
159
160 * User defined subroutines should use 'die' to signal errors.
161
162 * User defined subroutines can preliminary terminate options
163   processing by calling die("FINISH");
164
165 * Correct erroneous install of Getopt::Long manpage.
166   Previous versions seem to install Getopt::GetoptLong instead of
167   Getopt::Long.
168
169 Changes in version 2.20
170 -----------------------
171
172 * Prevent the magic argument "<>" from being interpreted as option
173   starter characters if it is the first argument passed.
174   To use the characters "<>" as option starters, pass "><" instead.
175
176 * Changed license: Getopt::Long may now also be used under the Perl
177   Artistic License.
178
179 * Changed the file name of the distribution kit from "GetoptLong..."
180   to "Getopt-Long-..." to match the standards.
181
182 Changes in version 2.19
183 -----------------------
184
185 * Fix a warning bug with bundling_override.
186
187 There's no version 2.18
188 -----------------------
189
190 Changes in version 2.17
191 -----------------------
192
193 * Getopt::Long::config is renamed Getopt::Long::Configure. The old
194   name will remain supported without being documented.
195
196 * Options can have the specifier '+' to denote that the option value
197   must be incremented each time the option occurs on the command line.
198   For example:
199
200      my $more = 2;
201      Getopt::Long::Configure("bundling");
202      GetOptions ("v+" => \$more);
203      print STDOUT ("more = $more\n");
204
205   will print "more = 3" when called with "-v", "more = 4" when called
206   with "-vv" (or "-v -v"), and so on.
207
208 * Getopt::Long now uses autoloading. This substantially reduces the
209   resources required to 'use Getopt::Long' (about 100 lines of over
210   1300 total).
211
212 * It is now documented that global option variables like $opt_foo
213   need to be declared using 'use vars ...' when running under 'use
214   strict'. 
215
216 * To install, it is now required to use the official procedure:
217
218      perl Makefile.PL
219      make
220      make test
221      make install
222
223 Changes in version 2.16
224 -----------------------
225
226 * A couple of small additional fixes to the $` $& $' fixes.
227
228 * The option prefix can be set using config("prefix=...") or, more
229   powerful, with config("prefix_pattern=..."); see the documentation
230   for details.
231
232 * More 'perl -w' warnings eliminated for obscure cases of bundling.
233
234 This version is identical to 2.15, which was not released.
235
236 There's no version 2.14
237 -----------------------
238
239 Changes in version 2.13
240 -----------------------
241
242 * All regexps are changed to avoid the use of $`, $& and $'. Using one
243   of these causes all pattern matches in the program to be much slower
244   than necessary.
245
246 * Configuration errors are signalled using die() and will cause the
247   program to be terminated (unless eval{...} or $SIG{__DIE__} is
248   used).
249
250 * Option parsing errors are now signalled with calls to warn().
251
252 * In option bundles, numeric values may be embedded in the bundle
253   (e.g. -al24w80).
254
255 * More 'perl -w' warnings eliminated for obscure cases of bundling.
256
257 * Removed non-standard version number matching. Version 1.121 is now
258   more than 1.12 but less than 1.13. 
259
260 Changes in version 2.12
261 -----------------------
262
263 * A single question mark is allowed as an alias to an option, e.g. 
264
265     GetOptions ("help|?", ...)
266
267 Changes in version 2.11
268 -----------------------
269
270 * User linkage may be an object, provided the object is really a hash.
271
272   For example:
273
274     {   package Foo;
275         sub new () { return bless {}; }
276     }
277
278     my $linkage = Foo->new();
279
280     GetOptions ($linkage, ... );
281
282 * Some bug fixes in handling obscure cases of pass-through.
283
284 Changes in version 2.9
285 ----------------------
286
287 * A new way to configure Getopt::Long. Instead of setting module local
288   variables, routine Getopt::Long::config can be called with the names
289   of options to be set or reset, e.g.
290
291     Getopt::Long::config ("no_auto_abbrev", "ignore_case");
292
293   Configuring by using the module local variables is deprecated, but
294   it will continue to work for backwark compatibility.
295
296 Changes in version 2.6
297 ----------------------
298
299 * Handle ignorecase even if autoabbrev is off. 
300
301 * POD corrections.
302
303 Changes in version 2.4
304 ----------------------
305
306 * Pass-through of unrecognized options. Makes it easy to write wrapper
307   programs that process some of the command line options but pass the
308   others to another program.
309
310 * Options can be of type HASH, now you can say
311
312     --define foo=bar
313
314   and have $opt_define{"foo"} set to "bar".
315
316 * An enhanced skeleton program, skel2.pl, that combines the power of
317   Getopt::Long with Pod::Usage. 
318   Module Pod::Usage can be obtained from CPAN,
319   http://www.perl.com/CPAN/authors/Brad_Appleton. 
320
321 Possible incompatibility in version 2.4
322 ---------------------------------------
323
324 Previous versions of Getopt::Long always downcased the option variable
325 names when ignorecase was in effect. This bug has been corrected. As a
326 consequence, &GetOptions ("Foo") will now set variable $opt_Foo
327 instead of $opt_foo.
328