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