diff options
author | René Scheibe <rene.scheibe@gmail.com> | 2014-09-25 16:13:18 +0200 |
---|---|---|
committer | René Scheibe <rene.scheibe@gmail.com> | 2014-09-29 10:37:21 +0200 |
commit | 710e4567db763a97319fa79d6093d3fc19a80c23 (patch) | |
tree | 5d6afd46e61c2567b77b8a76fc78be0b9331455e /bin/ninka | |
parent | d421685c5bd5ab3d6d6897d389bfe29181330759 (diff) | |
download | ninka-710e4567db763a97319fa79d6093d3fc19a80c23.tar.gz |
restructuring from multiple Perl scripts to modules
* no more intermediate files are generated
* improved reusability
Diffstat (limited to 'bin/ninka')
-rwxr-xr-x | bin/ninka | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/ninka b/bin/ninka new file mode 100755 index 0000000..beacc36 --- /dev/null +++ b/bin/ninka @@ -0,0 +1,29 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Getopt::Std; +use Ninka; + +my %opts = parse_cmdline_parameters(); +my $input_file = $ARGV[0]; +my $verbose = exists $opts{v}; + +my $license_result = Ninka::process_file($input_file, $verbose); +print "$input_file;$license_result\n"; +exit 0; + +sub parse_cmdline_parameters { + my %opts = (); + if (!getopts('v', \%opts) || scalar(@ARGV) == 0) { + print STDERR "Ninka v${Ninka::VERSION} + +Usage: $0 [options] <filename> + +Options: + -v verbose\n"; + + exit 1; + } + return %opts; +} |