From 2719d4b5ec49ade8b69ca0d352fe5511eb0215b0 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 5 Jul 2010 17:27:07 -0700 Subject: [PATCH] reorganize commands.py into sections for each subcommand --- beets/ui/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 8c9c91ac6..d9b90f6be 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -327,8 +327,11 @@ class SubcommandsOptionParser(optparse.OptionParser): def main(): """Run the main command-line interface for beets.""" + # Get the default subcommands. + from beets.ui.commands import default_commands + # Construct the root parser. - parser = SubcommandsOptionParser() + parser = SubcommandsOptionParser(subcommands=default_commands) parser.add_option('-l', '--library', dest='libpath', help='library database file to use') parser.add_option('-d', '--directory', dest='directory', @@ -337,10 +340,6 @@ def main(): help="destination path format string") parser.add_option('-i', '--device', dest='device', help="name of the device library to use") - - # Add default subcommands. - from beets.ui.commands import default_commands - parser.subcommands.extend(default_commands) # Parse the command-line! options, subcommand, suboptions, subargs = parser.parse_args()