summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Illig <roland.illig@gmx.de>2018-01-07 19:14:02 +0100
committerRoland Illig <roland.illig@gmx.de>2018-01-07 19:53:09 +0100
commit39e6fa1b967cec74b0744c5943639c27bdafa1ac (patch)
treef9b69a5daf085f2a8d364434370d58ccc489c860
parent81f185261c8863c5b84344ee31192870be939faf (diff)
downloadninka-39e6fa1b967cec74b0744c5943639c27bdafa1ac.tar.gz
bin/ninka: Accept more than one file argument
-rwxr-xr-xbin/ninka13
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/ninka b/bin/ninka
index 9cfd6aa..1f98eb2 100755
--- a/bin/ninka
+++ b/bin/ninka
@@ -6,12 +6,13 @@ 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";
+foreach my $input_file (@ARGV) {
+ my $license_result = Ninka::process_file($input_file, $create_intermediary_files, $verbose);
+ print "$input_file;$license_result\n";
+}
exit 0;
sub parse_cmdline_parameters {
@@ -19,7 +20,7 @@ sub parse_cmdline_parameters {
if (!getopts('iv', \%opts) || scalar(@ARGV) == 0) {
print STDERR "Ninka v${Ninka::VERSION}
-Usage: ninka [options] <filename>
+Usage: ninka [options] <filename>...
Options:
-i create intermediary files
@@ -40,7 +41,7 @@ ninka - source file license identification tool
=head1 SYNOPSYS
-B<ninka> [options] F<filename>
+B<ninka> [options] F<filename>...
=head1 DESCRIPTION
@@ -72,7 +73,7 @@ Determine the licenses in file F<foo.c>.
Determine the licenses in file F<foo.c> and create intermediary files (for debugging).
-=item find * | xargs -n1 -I@ B<ninka> '@'
+=item find * -type f -print | xargs -I@ B<ninka> '@'
Determine the licenses of files in a directory.