#!/usr/bin/perl -dw
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
#NAME
#  extracttunes - 
#
#SYNOPSIS
#  extracttunes [file]..
#REQUIRES
#
#DESCRIPTION
#
#OPTIONS
# None yet, but there may be some soon.
#
#EXAMPLES
#
#FILES
#
#BUGS
#
#SEE ALSO
#
#AUTHOR
#  John Chambers <jc@trillian.mit.edu>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

$| = 1;
$exitstat = 0;
($P = $0) =~ s".*/"";
$V = $ENV{"V_$P"} || $ENV{"D_$P"} || 2;	# Verbose level.

$files = 0;		# Number of files processed

foreach $a (@ARGV) {
	if (-f $a) {
		++$files;
		$cmd = "abcsplit +N +S_ '$a'";
		system $cmd;
	}
}
unless ($files > 0) {
	print "$P: No files on command line; reading file names from STDIN ...\n";
	for $a (<>) {
		$a =~ s/[\r\s]$//;
		if ($a) {
			++$files;
			$cmd = "abcsplit +N +S_ '$a'";
			system $cmd;
		}
	}
}
print "$P: $files files read.\n";

exit $exitstat;
