Skip to content

Commit

Permalink
--verbose (fix #939)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampsyo committed Sep 11, 2014
1 parent 6dd6d47 commit 72fd76b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions beets/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,8 @@ def __init__(self, *args, **kwargs):
help='path to configuration file')
self.add_option('-h', '--help', dest='help', action='store_true',
help='how this help message and exit')
self.add_option('--version', dest='version', action='store_true',
help=optparse.SUPPRESS_HELP)

# Our root parser needs to stop on the first unrecognized argument.
self.disable_interspersed_args()
Expand Down Expand Up @@ -948,9 +950,14 @@ def _raw_main(args, lib=None):
subcommands, plugins, lib = _setup(options, lib)

parser.add_subcommand(*subcommands)
subcommand, suboptions, subargs = parser.parse_subcommand(subargs)

subcommand.func(lib, suboptions, subargs)
if options.version:
from beets.ui import commands
commands.version_cmd.func(lib, None, None)
else:
subcommand, suboptions, subargs = parser.parse_subcommand(subargs)
subcommand.func(lib, suboptions, subargs)

plugins.send('cli_exit', lib=lib)


Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Fixes:
* :doc:`/plugins/play`: Add a ``relative_to`` config option. Thanks to
BrainDamage.
* Fix a crash when a MusicBrainz release has zero tracks.
* The ``--version`` flag now works as an alias for the ``version`` command.

.. _discogs_client: https://github.com/discogs/discogs_client

Expand Down

0 comments on commit 72fd76b

Please sign in to comment.