Add --path sugar

This commit is contained in:
Pedro Silva 2013-10-22 22:43:32 +02:00
parent 0eb70ebfa5
commit 35e727b86f

View file

@ -81,12 +81,18 @@ class DuplicatesPlugin(BeetsPlugin):
help='show all versions of duplicate\
tracks or albums')
self._command.parser.add_option('-p', '--path', dest='path',
action='store_true',
help='print paths for matched items\
or albums')
self._command.parser.add_option('-k', '--keys', dest='keys',
action='callback',
callback=vararg_callback,
help='report duplicates based on keys')
def commands(self):
def _dup(lib, opts, args):
opts.keys = opts.keys.split(',')
self.config.set_args(opts)
fmt = self.config['format'].get()
count = self.config['count'].get()
@ -99,6 +105,9 @@ class DuplicatesPlugin(BeetsPlugin):
else:
items = lib.items(decargs(args))
if opts.path:
fmt = '$path'
# Default format string for count mode.
if count and not fmt:
if album: