From 3f490440b647e7a9d700e5a3d1dcd71415e43a00 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 29 Aug 2015 12:56:39 -0700 Subject: [PATCH] Reduce footprint of #1582 No need for a separate function since we only use this once. --- beets/ui/__init__.py | 9 --------- beets/ui/commands.py | 6 ++---- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 35c1b1957..2acff947c 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -786,14 +786,6 @@ class CommonOptionsParser(optparse.OptionParser, object): self.add_path_option() self.add_format_option() - def add_help_text(self, text): - """Add a custom help text below the usage line to give extra hints - """ - if self._added_help is False: - self.usage = self.usage + "\n" - self._added_help = True - self.usage = self.usage + "\n" - self.usage = self.usage + text # Subcommand parsing infrastructure. # @@ -803,7 +795,6 @@ class CommonOptionsParser(optparse.OptionParser, object): # There you will also find a better description of the code and a more # succinct example program. - class Subcommand(object): """A subcommand of a root command-line application that may be invoked by a SubcommandOptionParser. diff --git a/beets/ui/commands.py b/beets/ui/commands.py index e87a1b18d..37b7ddc0a 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -973,10 +973,8 @@ def list_func(lib, opts, args): list_cmd = ui.Subcommand('list', help='query the library', aliases=('ls',)) -list_cmd.parser.add_help_text('query the library') -list_cmd.parser.add_help_text( - 'Example usage: %prog -f \'$album: $title\' artist:beatles' -) +list_cmd.parser.usage += "\n" \ + 'Example: %prog -af \'$album: $title\' artist:beatles' list_cmd.parser.add_all_common_options() list_cmd.func = list_func default_commands.append(list_cmd)