From bff9f2e80839ebb36792c8b340f6764ec8361089 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 20 Jan 2011 09:23:39 -0800 Subject: [PATCH] "beet version" command --- NEWS | 1 + beets/__init__.py | 4 +++- beets/ui/commands.py | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3bf2fb560..73236ae9f 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,7 @@ * Fixed an UnboundLocalError when no matches are found during autotag. * Fixed a Unicode encoding error when entering special characters into the "manual search" prompt. +* New command "beet version" just shows the current version. 1.0b5 ----- diff --git a/beets/__init__.py b/beets/__init__.py index 2f4efd8de..b081e5ca0 100644 --- a/beets/__init__.py +++ b/beets/__init__.py @@ -12,6 +12,8 @@ # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. +__version__ = '1.0b6' +__author__ = 'Adrian Sampson ' + import beets.library Library = beets.library.Library - diff --git a/beets/ui/commands.py b/beets/ui/commands.py index a90b31675..c4b404674 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -735,3 +735,13 @@ def stats_func(lib, config, opts, args): show_stats(lib, ui.make_query(args)) stats_cmd.func = stats_func default_commands.append(stats_cmd) + + +# version: Show current beets version. + +def show_version(lib, config, opts, args): + print 'beets version %s' % beets.__version__ +version_cmd = ui.Subcommand('version', + help='output version information') +version_cmd.func = show_version +default_commands.append(version_cmd)