]> git.donarmstrong.com Git - lib.git/blob - templates/perl_script
24254d5ad681174f86ab82fa58f4de7946983da2
[lib.git] / templates / perl_script
1 #! /usr/bin/perl
2 # , and is released
3 # under the terms of the GPL version 2, or any later version, at your
4 # option. See the file README and COPYING for more information.
5 # Copyright 2009 by Don Armstrong <don@donarmstrong.com>.
6 # $Id$
7
8
9 use warnings;
10 use strict;
11
12 use Getopt::Long;
13 use Pod::Usage;
14
15 =head1 NAME
16
17  - 
18
19 =head1 SYNOPSIS
20
21  [options]
22
23  Options:
24   --debug, -d debugging level (Default 0)
25   --help, -h display this help
26   --man, -m display manual
27
28 =head1 OPTIONS
29
30 =over
31
32 =item B<--debug, -d>
33
34 Debug verbosity. (Default 0)
35
36 =item B<--help, -h>
37
38 Display brief usage information.
39
40 =item B<--man, -m>
41
42 Display this manual.
43
44 =back
45
46 =head1 EXAMPLES
47
48
49 =cut
50
51
52 use vars qw($DEBUG);
53
54 my %options = (debug           => 0,
55                help            => 0,
56                man             => 0,
57                );
58
59 GetOptions(\%options,
60            'debug|d+','help|h|?','man|m');
61
62 pod2usage() if $options{help};
63 pod2usage({verbose=>2}) if $options{man};
64
65 $DEBUG = $options{debug};
66
67 my @USAGE_ERRORS;
68 if (1) {
69      push @USAGE_ERRORS,"You must pass something";
70 }
71
72 pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
73
74
75
76
77 __END__