tagged release 0.6.4
[parrot.git] / lib / Parrot / Ops2pm / Auxiliary.pm
blob439a4c5d2d5f7ead2f9ce2f8db7e5f8268883f08
1 # Copyright (C) 2007, The Perl Foundation.
2 # $Id$
3 package Parrot::Ops2pm::Auxiliary;
4 use strict;
5 use warnings;
6 use vars qw(@ISA @EXPORT_OK);
7 @ISA = qw( Exporter );
8 @EXPORT_OK = qw( Usage getoptions );
9 use Getopt::Long;
11 sub Usage {
12 print STDERR <<_EOF_;
13 usage: tools/build/ops2pm.pl [--help] [--no-lines] input.ops [input2.ops ...]
14 _EOF_
15 return 1;
18 sub getoptions {
19 my %flags;
20 GetOptions(
21 "no-lines" => \$flags{nolines},
22 "help" => \$flags{help},
23 "renum" => \$flags{renum},
25 return \%flags;
30 #################### DOCUMENTATION ####################
32 =head1 NAME
34 Parrot::Ops2pm::Auxiliary - Non-method subroutines holding functionality for F<tools/build/ops2pm.pl>.
36 =head1 SYNOPSIS
38 use Parrot::Ops2pm::Auxiliary qw( Usage getoptions );
40 Usage();
42 $flagref = getoptions();
44 =cut
46 =head1 DESCRIPTION
48 Parrot::Ops2pm::Auxiliary provides subroutines called by F<tools/build/ops2pm.pl>, a
49 program which is called at the very beginning of the Parrot F<make> process.
50 This package is intended to hold subroutines used by that program I<other
51 than> the object-oriented methods provided by Parrot::Ops2pm::Utils.
53 Extraction of the subroutines exported by this package from
54 F<tools/build/ops2pm.pl> facilitates the testing of their functionality by the
55 tests in F<t/tools/ops2pmutils/*.t>.
57 =head1 SUBROUTINES
59 =head2 C<Usage()>
61 =over 4
63 =item * Purpose
65 Display a short description of how to use F<tools/build/ops2pm.pl> on
66 standard output.
68 usage: tools/build/ops2pm.pl [--help] [--no-lines] input.ops [input2.ops ...]
70 =item * Arguments
72 None.
74 =item * Return Value
76 Implicitly returns true upon successful printing.
78 =back
80 =head2 C<getoptions>
82 =over 4
84 =item * Purpose
86 Process arguments provided on command-line to F<tools/build/ops2pm.pl>.
88 =item * Arguments
90 None.
92 =item * Return Value
94 Hash reference where any of the following keys may or may not be defined.
96 no-lines
97 help
98 renum
100 =item * Comment
102 A wrapper around Getopt::Long::GetOptions() designed to assure testability.
104 =back
106 =head1 AUTHOR
108 Jim Keenan (refactoring code originally found in F<tools/build/ops2pm.pl>).
110 =head1 SEE ALSO
112 Parrot::Ops2pm::Utils. F<tools/build/ops2pm.pl>.
114 =cut
116 # Local Variables:
117 # mode: cperl
118 # cperl-indent-level: 4
119 # fill-column: 100
120 # End:
121 # vim: expandtab shiftwidth=4: