summaryrefslogtreecommitdiff
path: root/rhimport
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-04-12 13:58:20 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-04-12 13:58:20 (GMT)
commita1870821bb62b7a4379276798f11e43b33ce0d0e (patch)
tree8708e79739584b44ec49bd19cfdc721411295eaa /rhimport
parent283dd3e8f08217e28170e47a79a4dc56a518ff69 (diff)
added error callback to command line
some cleanup git-svn-id: https://svn.helsinki.at/rhimport/trunk@37 7c65635b-ec39-4f67-a626-873dbafdd612
Diffstat (limited to 'rhimport')
-rwxr-xr-xrhimport12
1 files changed, 10 insertions, 2 deletions
diff --git a/rhimport b/rhimport
index 3e3a36e..15a030b 100755
--- a/rhimport
+++ b/rhimport
@@ -337,6 +337,14 @@ if(!$FILE || !$DROPBOX) {
###########################################
## command line mode
+my $cl_error_cb = sub {
+ my ($text) = @_;
+
+ print "\n$text .. cancel operation [Y/n]? ";
+ my $x = scalar(<STDIN>);
+ $x =~ /^n/i;
+};
+
(-e "$FILE") or die "file '$FILE' not found";
if($POOL) {
print "will import from playlist $FILE, with user $user\n\n";
@@ -365,9 +373,9 @@ if($POOL) {
rhimport::clear_carts($dbh, $group, $to_cart);
}
- $ret = rhimport::import_playlist($FILE, $DROPBOX);
+ $ret = rhimport::import_playlist($FILE, $DROPBOX, 0, $cl_error_cb);
} else {
- $ret = rhimport::import_single($FILE, $DROPBOX);
+ $ret = rhimport::import_single($FILE, $DROPBOX, 0);
}
$dbh->disconnect();