initial checkin
[migration-tools.git] / extract_loadset
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 use open ':utf8';
5
6 use Getopt::Long;
7
8 my $conf  = {}; # configuration hashref
9 initialize($conf);
10
11 open FP, '<', shift or die "Can't open input file: $!\n";
12
13 while (<FP>) {
14
15 }
16
17 sub initialize {
18     my ($c) = @_;
19     my @missing = ();
20
21     # set mode on existing filehandles
22     binmode(STDIN, ':utf8');
23
24     my $rc = GetOptions( $c,
25                          'prefix|p=s',
26                          'help|h',
27                        );
28     show_help() unless $rc;
29     show_help() if ($c->{help});
30
31     my @keys = keys %{$c};
32     show_help() unless (@ARGV and @keys);
33     for my $key ('prefix')
34       { push @missing, $key unless $c->{$key} }
35     if (@missing) {
36         print "Required option: ", join(', ', @missing), " missing!\n";
37         show_help();
38     }
39 }
40
41 sub show_help {
42     print <<HELP;
43 Usage is: compress_fingerprints -p PREFIX INPUTFILE
44 HELP
45 exit;
46 }