summaryrefslogtreecommitdiff
path: root/bin/ninka
blob: 4732cbe42140adbe49a09d848f99e54d1e0c1ffa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env perl

use strict;
use warnings;
use Getopt::Std;
use Ninka;

my %opts = parse_cmdline_parameters();
my $input_file = $ARGV[0];
my $create_intermediary_files = exists $opts{i};
my $verbose = exists $opts{v};

my $license_result = Ninka::process_file($input_file, $create_intermediary_files, $verbose);
print "$input_file;$license_result\n";
exit 0;

sub parse_cmdline_parameters {
    my %opts = ();
    if (!getopts('iv', \%opts) || scalar(@ARGV) == 0) {
        print STDERR "Ninka v${Ninka::VERSION}

Usage: $0 [options] <filename>

Options:
  -i create intermediary files
  -v verbose\n";

        exit 1;
    }
    return %opts;
}

__END__

=head1 NAME

ninka

=head1 DESCRIPTION

Scans a file and returns the found licenses.

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2009-2014  Yuki Manabe and Daniel M. German

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

=cut