about summary refs log tree commit homepage
path: root/bin/dtas-mlib
diff options
context:
space:
mode:
Diffstat (limited to 'bin/dtas-mlib')
-rwxr-xr-xbin/dtas-mlib4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/dtas-mlib b/bin/dtas-mlib
index 5fa2b63..28fef97 100755
--- a/bin/dtas-mlib
+++ b/bin/dtas-mlib
@@ -10,11 +10,13 @@ require 'dtas/mlib'
 require 'optparse'
 path = '~/.dtas/mlib.sqlite'
 db = File.expand_path(path)
+force = false
 OptionParser.new('', 24, '  ') do |op|
   op.banner = usage
   op.on('-d', '--database <URI|PATH>', "database (default: #{path}") do |d|
     db = d
   end
+  op.on('-f', '--force', 'force updates') { force = true }
   op.on('-h', '--help') do
     puts(op.to_s)
     exit
@@ -39,7 +41,7 @@ end
 case action = ARGV.shift
 when 'update', 'up'
   directory = ARGV.shift or abort "DIRECTORY required\n#{usage}"
-  mlib(db, migrate = true).update(directory)
+  mlib(db, migrate = true).update(directory, force: force)
 when 'stats'
   s = mlib(db, true).stats
   %w(artists albums songs db_playtime).each { |k| puts "#{k}: #{s[k.to_sym]}" }