From 35e727b86f0d408fc7df3a2c3e1407ae6754c84d Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 22 Oct 2013 22:43:32 +0200 Subject: [PATCH] Add --path sugar --- beetsplug/duplicates.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/beetsplug/duplicates.py b/beetsplug/duplicates.py index 94b4eba8b..3da633116 100644 --- a/beetsplug/duplicates.py +++ b/beetsplug/duplicates.py @@ -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: