updated git and svn scripts
[xrzperl.git] / perl_script.template
blob62f3006cc5288764e902c1647af30c9af25b23d1
1 #!/usr/bin/perl -w
2 # $Id$
3 use strict;
4 require v5.10.0;
5 our $VERSION = 'v0.1';
7 BEGIN
9 our $PROGRAM_DIR = $ENV{XR_PERL_SOURCE_DIR};
10 unless($PROGRAM_DIR) {
11 $PROGRAM_DIR = $0;
12 $PROGRAM_DIR =~ s/[^\/\\]+$//;
13 $PROGRAM_DIR =~ s/\/+$//;
14 $PROGRAM_DIR = "." unless($PROGRAM_DIR);
16 unshift @INC,
17 map "$PROGRAM_DIR/$_",qw{modules lib ../modules ..lib};
20 my %OPTS;
21 my @OPTIONS = qw/help|h|? version|ver edit-me manual|man/;
23 if(@ARGV)
25 require Getopt::Long;
26 require MyPlace::Usage;
27 Getopt::Long::GetOptions(\%OPTS,@OPTIONS);
28 MyPlace::Usage::Process(\%OPTS,$VERSION);
30 else
32 require MyPlace::Usage;
33 MyPlace::Usage::PrintHelp();
34 exit 0;
38 __END__
40 =pod
42 =head1 NAME
44 ___NAME___ - PERL script
46 =head1 SYNOPSIS
48 ___NAME___ [options] ...
50 =head1 OPTIONS
52 =over 12
54 =item B<--version>
56 Print version infomation.
58 =item B<-h>,B<--help>
60 Print a brief help message and exits.
62 =item B<--manual>,B<--man>
64 View application manual
66 =item B<--edit-me>
68 Invoke 'editor' against the source
70 =back
72 =head1 DESCRIPTION
74 ___DESC___
76 =head1 CHANGELOG
78 ___DATE___ ___AUTHOR___ <___EMAIL___>
80 * file created.
82 =head1 AUTHOR
84 ___AUTHOR___ <___EMAIL___>
86 =cut
88 # vim:filetype=perl