From 1ebe1cf728c65b9e47f2682a98169823aea5b9b5 Mon Sep 17 00:00:00 2001 From: Matteo Mecucci Date: Sun, 15 Apr 2012 16:28:12 +0200 Subject: [PATCH] Added fields command to output a list of available fields for queries and format strings. --- beets/ui/commands.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 061fc3ab9..0895e6142 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -84,6 +84,19 @@ def _showdiff(field, oldval, newval, color): print_(u' %s: %s -> %s' % (field, oldval, newval)) +# fields: Shows a list of available fields for queries and format strings. +fields_cmd = ui.Subcommand('fields', + help='show fields available for queries and format strings') +def fields_func(lib, config, opts, args): + print "Available item fields:" + print " " + "\n ".join([key for key in library.ITEM_KEYS]) + print "\nAvailable album fields:" + print " " + "\n ".join([key for key in library.ALBUM_KEYS]) + +fields_cmd.func = fields_func +default_commands.append(fields_cmd) + + # import: Autotagger and importer. DEFAULT_IMPORT_COPY = True