From 39e6fa1b967cec74b0744c5943639c27bdafa1ac Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Sun, 7 Jan 2018 19:14:02 +0100 Subject: bin/ninka: Accept more than one file argument --- bin/ninka | 13 +++++++------ 1 file 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] +Usage: ninka [options] ... Options: -i create intermediary files @@ -40,7 +41,7 @@ ninka - source file license identification tool =head1 SYNOPSYS -B [options] F +B [options] F... =head1 DESCRIPTION @@ -72,7 +73,7 @@ Determine the licenses in file F. Determine the licenses in file F and create intermediary files (for debugging). -=item find * | xargs -n1 -I@ B '@' +=item find * -type f -print | xargs -I@ B '@' Determine the licenses of files in a directory. -- cgit v1.2.1