1Getopt::Euclid(3) User Contributed Perl Documentation Getopt::Euclid(3)
2
3
4
6 Getopt::Euclid - Executable Uniform Command-Line Interface Descriptions
7
9 This document describes Getopt::Euclid version 0.1.0
10
12 use Getopt::Euclid;
13
14 if ($ARGV{-i}) {
15 print "Interactive mode...\n";
16 }
17
18 for my $x (0..$ARGV{-size}{h}-1) {
19 for my $y (0..$ARGV{-size}{w}-1) {
20 do_something_with($x, $y);
21 }
22 }
23
24 __END__
25
26 =head1 NAME
27
28 yourprog - Your program here
29
30 =head1 VERSION
31
32 This documentation refers to yourprog version 1.9.4
33
34 =head1 USAGE
35
36 yourprog [options] -s[ize]=<h>x<w> -o[ut][file] <file>
37
38 =head1 REQUIRED ARGUMENTS
39
40 =over
41
42 =item -s[ize]=<h>x<w>
43
44 Specify size of simulation
45
46 =for Euclid:
47 h.type: int > 0
48 h.default: 24
49 w.type: int >= 10
50 w.default: 80
51
52 =item -o[ut][file] <file>
53
54 Specify output file
55
56 =for Euclid:
57 file.type: writable
58 file.default: '-'
59
60 =back
61
62 =head1 OPTIONS
63
64 =over
65
66 =item -i
67
68 Specify interactive simulation
69
70 =item -l[[en][gth]] <l>
71
72 Length of simulation [default: 99]
73
74 =for Euclid:
75 l.type: int > 0
76 l.default: 99
77
78 =item --version
79
80 =item --usage
81
82 =item --help
83
84 =item --man
85
86 Print the usual program information
87
88 =back
89
90 Remainder of documentation starts here...
91
92 =head1 AUTHOR
93
94 Damian Conway (DCONWAY@CPAN.org)
95
96 =head1 BUGS
97
98 There are undoubtedly serious bugs lurking somewhere in this code.
99 Bug reports and other feedback are most welcome.
100
101 =head1 COPYRIGHT
102
103 Copyright (c) 2005, Damian Conway. All Rights Reserved.
104 This module is free software. It may be used, redistributed
105 and/or modified under the terms of the Perl Artistic License
106 (see http://www.perl.com/perl/misc/Artistic.html)
107
109 Getopt::Euclid uses your program's own documentation to create a com‐
110 mand-line argument parser. This ensures that your program's documented
111 interface and its actual interface always agree.
112
113 To use the module, you simply write:
114
115 use Getopt::Euclid;
116
117 at the top of your program.
118
119 When the module is loaded within a regular Perl program, it will:
120
121 1. locate any POD in the same file,
122
123 2. extract information from that POD, most especially from the "=head1
124 REQUIRED ARGUMENTS" and "=head1 OPTIONS" sections,
125
126 3. build a parser that parses the arguments and options the POD speci‐
127 fies,
128
129 4. parse the contents of @ARGV using that parser, and
130
131 5. put the results in the global %ARGV variable (or into specifically
132 named optional variables, if you request that -- see "Exporting
133 Option Variables").
134
135 As a special case, if the module is loaded within some other module
136 (i.e. from within a ".pm" file), it still locates and extracts POD
137 information, but instead of parsing @ARGV immediately, it caches that
138 information and installs an "import()" subroutine in the caller module.
139 That new "import()" acts just like Getopt::Euclid's own import, except
140 that it adds the POD from the caller module to the POD of the callee.
141
142 All of which just means you can put some or all of your CLI specifica‐
143 tion in a module, rather than in the application's source file. See
144 "Module Interface" for more details.
145
147 Program Interface
148
149 You write:
150
151 use Getopt::Euclid;
152
153 and your command-line is parsed automagically.
154
155 There are no options to pass. Getopt::Euclid doesn't export anything.
156 It just works.
157
158 Module Interface
159
160 You write:
161
162 use Getopt::Euclid;
163
164 and your module will then act just like Getopt::Euclid (i.e. you can
165 use your module instead of Getopt::Euclid>, except that your module's
166 POD will also be prepended to the POD of any module that loads yours.
167 In other words, you can use Getopt::Euclid in a module to create a
168 standard set of CLI arguments, which can then be added to any applica‐
169 tion simply by loading your module.
170
171 To accomplish this trick Getopt::Euclid installs an "import()" subrou‐
172 tine in your module. If your module already has an "import()" subrou‐
173 tine defined, terrible things happen. So don't do that.
174
175 POD Interface
176
177 This is where all the action is.
178
179 When Getopt::Euclid is loaded in a non-".pm" file, it searches that
180 file for the following POD documentation:
181
182 =head1 NAME
183 Getopt::Euclid ignores the name specified here. In fact, if you use
184 the standard "--help", "--usage", "--man", or "--version" arguments
185 (see "Standard arguments"), the module replaces the name specified
186 in this POD section with the actual name by which the program was
187 invoked (i.e. with $0).
188
189 =head1 USAGE
190 Getopt::Euclid ignores the usage line specified here. If you use
191 the standard "--help", "--usage", or "--man" arguments, the module
192 replaces the usage line specified in this POD section with a usage
193 line that reflects the actual interface that the module has con‐
194 structed.
195
196 =head1 VERSION
197 Getopt::Euclid extracts the current version number from this POD
198 section. To do that it simply takes the first substring that
199 matches <digit>.<digit> or <digit>_<digit>. It also accepts one or
200 more additional trailing .<digit> or _<digit>, allowing for multi-
201 level and "alpha" version numbers such as:
202
203 =head1 VERSION
204
205 This is version 1.2.3
206
207 or:
208
209 =head1 VERSION
210
211 This is alpha release 1.2_34
212
213 =head1 REQUIRED ARGUMENTS
214 Getopt::Euclid uses the specifications in this POD section to build
215 a parser for command-line arguments. That parser requires that
216 every one of the specified arguments is present in any command-line
217 invocation. See "Specifying arguments" for details of the specifi‐
218 cation syntax.
219
220 The actual headings that Getopt::Euclid can recognize here are:
221
222 =head1 [STD⎪STANDARD] REQUIRED [ARG⎪ARGUMENT][S]
223
224 =head1 OPTIONS
225 Getopt::Euclid uses the specifications in this POD section to build
226 a parser for command-line arguments. That parser does not require
227 that any of the specified arguments is actually present in a com‐
228 mand-line invocation. Again, see "Specifying arguments" for
229 details of the specification syntax.
230
231 Typically a program will specify both "REQUIRED ARGUMENTS" and
232 "OPTIONS", but there is no requirement that it supply both, or
233 either.
234
235 The actual headings that Getopt::Euclid recognizes here are:
236
237 =head1 [STD⎪STANDARD] OPTION[AL⎪S] [ARG⎪ARGUMENT][S]
238
239 =head1 COPYRIGHT
240 Getopt::Euclid prints this section whenever the standard "--ver‐
241 sion" option is specified on the command-line.
242
243 The actual heading that Getopt::Euclid recognizes here is any head‐
244 ing containing any of the words "COPYRIGHT", "LICENCE", or
245 "LICENSE".
246
247 Specifying arguments
248
249 Each required or optional argument is specified in the POD in the fol‐
250 lowing format:
251
252 =item ARGUMENT_STRUCTURE
253
254 ARGUMENT_DESCRIPTION
255
256 =for Euclid:
257 ARGUMENT_OPTIONS
258 PLACEHOLDER_CONSTRAINTS
259
260 Argument structure
261
262 · Each argument is specified as an "=item".
263
264 · Any part(s) of the specification that appear in square brackets are
265 treated as optional.
266
267 · Any parts that appear in angle brackets are placeholders for actual
268 values that must be specified on the command-line.
269
270 · Any placeholder that is immediately followed by "..." may be
271 repeated as many times as desired.
272
273 · Any whitespace in the structure specifies that any amount of white‐
274 space (including none) is allowed at the same position on the com‐
275 mand-line.
276
277 · A vertical bar within an optional component indicates an alterna‐
278 tive. Note that such vertical bars may only appear within square
279 brackets.
280
281 For example, the argument specification:
282
283 =item -i[n] [=] <file>
284
285 indicates that any of the following may appear on the command-line:
286
287 -idata.txt -i data.txt -i=data.txt -i = data.txt
288
289 -indata.txt -in data.txt -in=data.txt -in = data.txt
290
291 as well as any other combination of whitespacing.
292
293 Any of the above variations would cause both $ARGV{'-i'} and "$ARGV{'-
294 in'}" to be set to the string 'data.txt'.
295
296 You could allow the optional "=" to also be an optional colon by speci‐
297 fying:
298
299 =item -i[n] [=⎪:] <file>
300
301 Optional components may also be nested, so you could write:
302
303 =item -i[n[put]] [=] <file>
304
305 which would allow "-i", "-in", and "-input" as synonyms for this argu‐
306 ment and would set all three of $ARGV{'-i'}, $ARGV{'-in'}, and
307 $ARGV{'-input'} to the supplied file name.
308
309 The point of setting every possible variant within %ARGV is that this
310 allows you to use a single key (say $ARGV{'-input'}, regardless of how
311 the argument is actually specified on the command-line.
312
313 Repeatable arguments
314
315 Normally Getopt::Euclid only accepts each specified argument once, the
316 first time it appears in @ARGV. However, you can specify that an argu‐
317 ment may appear more than once, using the "repeatable" option:
318
319 =item file=<filename>
320
321 =for Euclid:
322 repeatable
323
324 When an argument is marked repeatable the corresponding entry of %ARGV
325 will not contain a hash reference, but rather an array of hash refer‐
326 ences, each of which records each repetition.
327
328 Boolean arguments
329
330 If an argument has no placeholders it is treated as a boolean switch
331 and it's entry in %ARGV will be true if the argument appeared in @ARGV.
332
333 For a boolean argument, you can also specify variations that are false,
334 if they appear. For example, a common idiom is:
335
336 =item --print
337
338 Print results
339
340 =item --noprint
341
342 Don't print results
343
344 These two arguments are effectively the same argument, just with oppo‐
345 site boolean values. However, as specified above, only one of
346 $ARGV{'--print'} and $ARGV{'--noprint'} will be set.
347
348 As an alternative you can specify a single argument that accepts either
349 value and sets both appropriately:
350
351 =item --[no]print
352
353 [Don't] print results
354
355 =for Euclid:
356 false: --noprint
357
358 With this specification, if "--print" appears in @ARGV, then
359 $ARGV{'--print'} will be true and $ARGV{'--noprint'} will be false. On
360 the other hand, if "--noprint" appears in @ARGV, then $ARGV{'--print'}
361 will be false and $ARGV{'--noprint'} will be true.
362
363 The specified false values can follow any convention you wish:
364
365 =item [+⎪-]print
366
367 =for Euclid:
368 false: -print
369
370 or:
371
372 =item -report[_no[t]]
373
374 =for Euclid:
375 false: -report_no[t]
376
377 et cetera.
378
379 Multiple placeholders
380
381 An argument can have two or more placeholders:
382
383 =item -size <h> <w>
384
385 The corresponding command line argument would then have to provide two
386 values:
387
388 -size 24 80
389
390 Multiple placeholders can optionally be separated by literal characters
391 (which must then appear on the command-line). For example:
392
393 =item -size <h>x<w>
394
395 would then require a command-line of the form:
396
397 -size 24x80
398
399 If an argument has two or more placeholders, the corresponding entry in
400 %ARGV becomes a hash reference, with each of the placeholder names as
401 one key. That is, the above command-line would set both
402 $ARGV{'-size'}{'h'} and $ARGV{'-size'}{'w'}.
403
404 Optional placeholders
405
406 Placeholders can be specified as optional as well:
407
408 =item -size <h> [<w>]
409
410 This specification then allows either:
411
412 -size 24
413
414 or:
415
416 -size 24 80
417
418 on the command-line. If the second placeholder value is not provided,
419 the corresponding $ARGV{'-size'}{'w'} entry is set to "undef". See also
420 "Placeholder defaults".
421
422 Unflagged placeholders
423
424 If an argument consists of a single placeholder with no "flag" marking
425 it:
426
427 =item <filename>
428
429 then the corresponding entry in %ARG will have a key the same as the
430 placeholder (including the surrounding angle brackets):
431
432 if ($ARGV{'<filename>'} eq '-') {
433 $fh = \*STDIN;
434 }
435
436 The same is true for any more-complicated arguments that begin with a
437 placeholder:
438
439 =item <h> [x <w>]
440
441 The only difference in the more-complex cases is that, if the argument
442 has any additional placeholders, the entire entry in %ARGV becomes a
443 hash:
444
445 my $total_size
446 = $ARGV{'<h>'}{'h'} * $ARGV{'<h>'}{'w'}
447
448 Note that, as in earlier multi-placeholder examples, the individual
449 second- level placeholder keys don't retain their angle-brackets.
450
451 Repeated placeholders
452
453 Any placeholder that is immediately followed by "...", like so:
454
455 =item -lib <files>...
456
457 =item <offsets>...
458
459 =for Euclid:
460 offsets.type: integer > 0
461
462 will match as many times as possible, but at least once. Note that this
463 implies that an unconstrained repeated unflagged placeholder (see
464 "Placeholder constraints" and "Unflagged placeholders") will consume
465 the rest of the command-line, and so should be specified last in the
466 POD.
467
468 If a placeholder is repeated, the corresponding entry in %ARGV will
469 then be an array reference, with each individual placeholder match in a
470 separate element. For example:
471
472 for my $lib (@{ $ARGV{'-lib'} }) {
473 add_lib($lib);
474 }
475
476 warn "First offset is: $ARGV{'<offsets>'}[0]";
477 my $first_offset = shift @{ $ARGV{'<offsets>'} };
478
479 Placeholder constraints
480
481 You can specify that the value provided for a particular placeholder
482 must satisfy a particular set of restrictions by using a "=for Euclid"
483 block. For example:
484
485 =item -size <h>x<w>
486
487 =for Euclid:
488 h.type: integer
489 w.type: integer
490
491 specifies that both the "<h>" and "<w>" must be given integers. You
492 can also specify an operator expression after the type name:
493
494 =for Euclid:
495 h.type: integer > 0
496 w.type: number <= 100
497
498 specifies that "<h>" has to be given an integer that's greater than
499 zero, and that "<w>" has to be given a number (not necessarily an inte‐
500 ger) that's no more than 100.
501
502 These type constraints have two alternative syntaxes:
503
504 PLACEHOLDER.type: TYPE BINARY_OPERATOR EXPRESSION
505
506 as shown above, and the more general:
507
508 PLACEHOLDER.type: TYPE [, EXPRESSION_INVOLVING(PLACEHOLDER)]
509
510 Using the second syntax, you could write the previous constraints as:
511
512 =for Euclid:
513 h.type: integer, h > 0
514 w.type: number, w <= 100
515
516 In other words, the first syntax is just sugar for the most common case
517 of the second syntax. The expression can be as complex as you wish and
518 can refer to the placeholder as many times as necessary:
519
520 =for Euclid:
521 h.type: integer, h > 0 && h < 100
522 w.type: number, Math::is_prime(w) ⎪⎪ w % 2 == 0
523
524 Note that the expressions are evaluated in the "package main" names‐
525 pace, so it's important to qualify any subroutines that are not in that
526 namespace. Furthermore, any subroutines used must be defined (or
527 loaded from a module) before the "use Getopt::Euclid" statement.
528
529 Standard placeholder types
530
531 Getopt::Euclid recognizes the following standard placeholder types:
532
533 Name Placeholder value... Synonyms
534 ============ ==================== ================
535
536 integer ...must be an integer int i
537
538 +integer ...must be a positive +int +i
539 integer
540 (same as: integer > 0)
541
542 0+integer ...must be a positive 0+int 0+i
543 integer or zero
544 (same as: integer >= 0)
545
546 number ...must be an number num n
547
548 +number ...must be a positive +num +n
549 number
550 (same as: number > 0)
551
552 0+number ...must be a positive 0+num 0+n
553 number or zero
554 (same as: number >= 0)
555
556 string ...may be any string str s
557 (default type)
558
559 readable ...must be the name input in
560 of a readable file
561
562 writeable ...must be the name writable output out
563 of a writeable file
564 (or of a non-existent
565 file in a writeable
566 directory)
567
568 /<regex>/ ...must be a string
569 matching the specified
570 pattern
571
572 Placeholder type errors
573
574 If a command-line argument's placeholder value doesn't satisify the
575 specified type, an error message is automatically generated. However,
576 you can provide your own message instead, using the ".type.error" spec‐
577 ifier:
578
579 =for Euclid:
580 h.type: integer, h > 0 && h < 100
581 h.type.error: <h> must be between 0 and 100 (not h)
582
583 w.type: number, Math::is_prime(w) ⎪⎪ w % 2 == 0
584 w.type.error: Can't use w for <w> (must be an even prime number)
585
586 Whenever an explicit error message is provided, any occurrence within
587 the message of the placeholder's unbracketed name is replaced by the
588 placeholder's value (just as in the type test itself).
589
590 Placeholder defaults
591
592 You can also specify a default value for any placeholders that aren't
593 given values on the command-line (either because their argument isn't
594 provided at all, or because the placeholder is optional within the
595 argument).
596
597 For example:
598
599 =item -size <h>[x<w>]
600
601 Set the size of the simulation
602
603 =for Euclid:
604 h.default: 24
605 w.default: 80
606
607 This ensures that if no "<w>" value is supplied:
608
609 -size 20
610
611 then $ARGV{'-size'}{'w'} is set to 80.
612
613 Likewise, of the "-size" argument is omitted entirely, both
614 $ARGV{'-size'}{'h'} and $ARGV{'-size'}{'w'} are set to their respective
615 default values.
616
617 The default value can be any valid Perl compile-time expression:
618
619 =item -pi=<pi value>
620
621 =for Euclid:
622 pi value.default: atan2(0,-1)
623
624 Argument cuddling
625
626 Getopt::Euclid allows any "flag" argument to be "cuddled". A flag argu‐
627 ment consists of a single non- alphanumeric character, followed by a
628 single alpha-numeric character:
629
630 =item -v
631
632 =item -x
633
634 =item +1
635
636 =item =z
637
638 Cuddling means that two or more such arguments can be concatenated
639 after a single common non-alphanumeric. For example:
640
641 -vx
642
643 Note, however, that only flags with the same leading non-alphanumeric
644 can be cuddled together. Getopt::Euclid would not allow:
645
646 -vxz
647
648 That's because cuddling is recognized by progressively removing the
649 second character of the cuddle. In other words:
650
651 -vxz
652
653 becomes:
654
655 -v -xz
656
657 which becomes:
658
659 -v -x z
660
661 which will fail, unless a "z" argument has also been specified.
662
663 On the other hand, if the argument:
664
665 =item -e <cmd>
666
667 had been specified, the module would accept:
668
669 -vxe'print time'
670
671 as a cuddled version of:
672
673 -v -x -e'print time'
674
675 Exporting Option Variables
676
677 By default, the module only stores arguments into the global %ARGV
678 hash. You can request that options are exported as variables into the
679 calling package the special ':vars' specifier:
680
681 use Getopt::Euclid qw( :vars );
682
683 That is, if your program accepts the following arguments:
684
685 -v
686 --mode <modename>
687 <infile>
688 <outfile>
689 --auto-fudge <factor> (repeatable)
690 --also <a>...
691 --size <w>x<h>
692
693 Then these variables will be exported
694
695 $ARGV_v
696 $ARGV_mode
697 $ARGV_infile
698 $ARGV_outfile
699 @ARGV_auto_fudge
700 @ARGV_also
701 %ARGV_size # With entries $ARGV_size{w} and $ARGV_size{h}
702
703 For options that have multiple variants, only the longest variant is
704 exported.
705
706 The type of variable exported (scalar, hash, or array) is determined by
707 the type of the corresponding value in %ARGV. Command-line flags and
708 arguments that take single values will produce scalars, arguments that
709 take multiple values will produce hashes, and repeatable arguments will
710 produce arrays.
711
712 If you don't like the default prefix of "ARGV_", you can specify your
713 own, such as "opt_", like this:
714
715 use Getopt::Euclid qw( :vars<opt_> );
716
717 The major advantage of using exported variables is that any misspelling
718 of argument variables in your code will be caught at compile-time by
719 "use strict".
720
721 Standard arguments
722
723 Getopt::Euclid automatically provides four standard arguments to any
724 program that uses the module. The behaviours of these arguments are
725 "hard- wired" and cannot be changed, not even by defining your own
726 arguments of the same name.
727
728 The standard arguments are:
729
730 --usage
731 This argument cause the program to print a short usage summary and
732 exit.
733
734 --help
735 This argument cause the program to print a longer usage summary
736 (including a full list of required and optional arguments) and
737 exit.
738
739 --man
740 This argument cause the program to print the complete POD documen‐
741 tation for the program and exit. If the standard output stream is
742 connected to a terminal and the POD::Text module is available, the
743 POD is formatted before printing. If the IO::Page or
744 IO::Pager::Page module is available, the formatted documentation is
745 then paged.
746
747 If standard output is not connected to a terminal or POD::Text is
748 not available, the POD is not formatted.
749
750 --version
751 This argument causes the program to print the version number of the
752 program (as specified in the "=head1 VERSION" section of the POD)
753 and any copyright information (as specified in the "=head1 COPY‐
754 RIGHT" POD section) and then exit.
755
756 Minimalist keys
757
758 By default, the keys of %ARGV will match the program's interface
759 exactly. That is, if your program accepts the following arguments:
760
761 -v
762 --mode <modename>
763 <infile>
764 <outfile>
765 --auto-fudge
766
767 Then the keys that appear in %ARGV will be:
768
769 '-v'
770 '--mode'
771 '<infile>'
772 '<outfile>'
773 '--auto-fudge'
774
775 In some cases, however, it may be preferable to have Getopt::Euclid set
776 up those hash keys without "decorations". That is, to have the keys of
777 %ARGV be simply:
778
779 'v'
780 'mode'
781 'infile'
782 'outfile'
783 'auto_fudge'
784
785 You can arrange this by loading the module with the special ':mini‐
786 mal_keys' specifier:
787
788 use Getopt::Euclid qw( :minimal_keys );
789
790 Note that, in rare cases, using this mode may cause you to lose data
791 (for example, if the interface specifies both a "--step" and a "<step>"
792 option). The module throws an exception if this happens.
793
795 Compile-time diagnostics
796
797 The following diagnostics are mainly caused by problems in the POD
798 specification of the command-line interface:
799
800 Getopt::Euclid was unable to access POD
801 Something is horribly wrong. Getopt::Euclid was unable to read your
802 program to extract the POD from it. Check your program's permis‐
803 sions, though it's a mystery how perl was able to run the program
804 in the first place, if it's not readable.
805
806 .pm file cannot define an explicit import() when using Getopt::Euclid
807 You tried to define an "import()" subroutine in a module that was
808 also using Getopt::Euclid. Since the whole point of using
809 Getopt::Euclid in a module is to have it build an "import()" for
810 you, supplying your own "import()" as well defeats the purpose.
811
812 Unknown specification: %s
813 You specified something in a "=for Euclid" section that
814 Getopt::Euclid didn't understand. This is often caused by typos, or
815 by reversing a placeholder.type or placeholder.default specifica‐
816 tion (that is, writing type.placeholder or default.placeholder
817 instead).
818
819 Unknown type (%s) in specification: %s
820 Unknown .type constraint: %s
821 Both these errors mean that you specified a type constraint that
822 Getopt::Euclid didn't recognize. This may have been a typo:
823
824 =for Euclid
825 count.type: inetger
826
827 or else the module simply doesn't know about the type you speci‐
828 fied:
829
830 =for Euclid
831 count.type: complex
832
833 See "Standard placeholder types" for a list of types that
834 Getopt::Euclid does recognize.
835
836 Invalid .type constraint: %s
837 You specified a type constraint that isn't valid Perl. For example:
838
839 =for Euclid
840 max.type: integer not equals 0
841
842 instead of:
843
844 =for Euclid
845 max.type: integer != 0
846
847 Invalid .default value: %s
848 You specified a default value that isn't valid Perl. For example:
849
850 =for Euclid
851 curse.default: *$@!&
852
853 instead of:
854
855 =for Euclid
856 curse.default: '*$@!&'
857
858 Invalid constraint: %s (No <%s> placeholder in argument: %s)
859 You attempted to define a ".type" constraint for a placeholder that
860 didn't exist. Typically this is the result of the misspelling of a
861 placeholder name:
862
863 =item -foo <bar>
864
865 =for Euclid:
866 baz.type: integer
867
868 or a "=for Euclid:" that has drifted away from its argument:
869
870 =item -foo <bar>
871
872 =item -verbose
873
874 =for Euclid:
875 bar.type: integer
876
877 Getopt::Euclid loaded a second time
878 You tried to load the module twice in the same program.
879 Getopt::Euclid doesn't work that way. Load it only once.
880
881 Unknown mode ('%s')
882 The only argument that a "use Getopt::Euclid" command accepts is
883 ':minimal_keys' (see "Minimalist keys"). You specified something
884 else instead (or possibly forgot to put a semicolon after "use
885 Getopt::Euclid").
886
887 Internal error: minimalist mode caused arguments '%s' and '%s' to clash
888 Minimalist mode removes certain characters from the keys hat are
889 returned in %ARGV. This can mean that two command-line options
890 (such as "--step" and "<step>") map to the same key (i.e. 'step').
891 This in turn means that one of the two options has overwritten the
892 other within the %ARGV hash. The program developer should either
893 turn off ':minimal_keys' mode within the program, or else change
894 the name of one of the options so that the two no longer clash.
895
896 Run-time diagnostics
897
898 The following diagnostics are caused by problems in parsing the com‐
899 mand-line
900
901 Missing required argument(s): %s
902 One or more arguments specified in the "REQUIRED ARGUMENTS" POD
903 section wasn't present on the command-line.
904
905 Invalid %s argument. %s must be %s but the supplied value (%s) isn't.
906 Getopt::Euclid recognized the argument you were trying to specify
907 on the command-line, but the value you gave to one of that argu‐
908 ment's placeholders was of the wrong type.
909
910 Unknown argument: %s
911 Getopt::Euclid didn't recognize an argument you were trying to
912 specify on the command-line. This is often caused by command-line
913 typos.
914
916 Getopt::Euclid requires no configuration files or environment vari‐
917 ables.
918
920 · File::Spec::Functions
921
922 · List::Util
923
925 None reported.
926
928 No bugs have been reported.
929
930 Please report any bugs or feature requests to
931 "bug-getopt-euclid@rt.cpan.org", or through the web interface at
932 <http://rt.cpan.org>.
933
935 Damian Conway "<DCONWAY@cpan.org>"
936
938 Copyright (c) 2005, Damian Conway "<DCONWAY@cpan.org>". All rights
939 reserved.
940
941 This module is free software; you can redistribute it and/or modify it
942 under the same terms as Perl itself.
943
945 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
946 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
947 WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
948 PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
949 EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
950 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
951 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
952 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
953 NECESSARY SERVICING, REPAIR, OR CORRECTION.
954
955 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
956 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
957 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
958 TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CON‐
959 SEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFT‐
960 WARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
961 INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
962 THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER
963 OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
964
965
966
967perl v5.8.8 2007-11-18 Getopt::Euclid(3)