Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6887 dpurdie 1
#! perl
2
########################################################################
3
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
4
#
5
# Module name   : jats.sh
6
# Module type   : Makefile system
7
# Compiler(s)   : n/a
8
# Environment(s): jats
9
#
10
# Description   : Create a file - using the jats touch
11
#
12
#......................................................................#
13
 
14
require 5.006_001;
15
use strict;
16
use warnings;
17
#use Data::Dumper;
18
use Getopt::Long;
19
use Pod::Usage;                         # required for help support
20
use FileUtils;
21
 
22
my $opt_verbose = 0;                    # Verbosity
23
my $opt_help = 0;
24
my $opt_manual;
25
 
26
#
27
#   Globals
28
#
29
my $VERSION = "1.0";
30
 
31
#-------------------------------------------------------------------------------
32
# Function        : Main Entry
33
#
34
# Description     : This small program will process hijacked files in a
35
#                   static view. It will create a branch for the file and then
36
#                   check the file in on the branch
37
#
38
#
39
# Inputs          : None
40
#
41
# Returns         : Even less.
42
#
43
 
44
my $result = GetOptions (
45
                "help+"     => \$opt_help,          # flag, multiple use allowed
46
                "manual"    => \$opt_manual,        # flag
47
                "verbose+"  => \$opt_verbose,       # flag
48
                );
49
 
50
#
51
#   Process help and manual options
52
#
53
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
54
pod2usage(-verbose => 1)  if ($opt_help == 2 );
55
pod2usage(-verbose => 2)  if ($opt_manual || ($opt_help > 2));
56
 
57
error ("No files to process")
58
    unless ( $#ARGV >= 0  );
59
 
60
#
61
#   Process files one by one
62
#
63
foreach  ( @ARGV )
64
{
65
    process_file( $_ );
66
}
67
exit;
68
 
69
 
70
#-------------------------------------------------------------------------------
71
# Function        : process_file
72
#
73
# Description     : Process one file
74
#
75
# Inputs          : A single file
76
#
77
# Returns         :
78
#
79
sub process_file
80
{
81
    my ($file) = @_;
82
    my $info = "aa" x 10;
83
    FileAppend ( $file, $info );
84
}
85
 
86
 
87
#-------------------------------------------------------------------------------
88
#   Documentation
89
#
90
 
91
=pod
92
 
93
=head1 NAME
94
 
95
xxxxx - Save a hijacked file on a private branch
96
 
97
=head1 SYNOPSIS
98
 
99
  xxxxxx [options] files...
100
 
101
 Options:
102
    -help               - brief help message
103
    -help -help         - Detailed help message
104
    -man                - Full documentation
105
    -verbose            - Verbose operation
106
 
107
=head1 OPTIONS
108
 
109
=over 8
110
 
111
=item B<-help>
112
 
113
Print a brief help message and exits.
114
 
115
=item B<-help -help>
116
 
117
Print a detailed help message with an explanation for each option.
118
 
119
=item B<-man>
120
 
121
Prints the manual page and exits.
122
 
123
=item B<-verbose>
124
 
125
Increases program output. This option may be specified mutiple times
126
 
127
=back
128
 
129
=head1 DESCRIPTION
130
 
131
This small program will process hijacked files in a static view. It will create
132
a branch for the file and then check the file in on the branch
133
 
134
=cut
135