Reduce footprint of #1582

No need for a separate function since we only use this once.
This commit is contained in:
Adrian Sampson 2015-08-29 12:56:39 -07:00
parent 83c55f9374
commit 3f490440b6
2 changed files with 2 additions and 13 deletions

View file

@ -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.

View file

@ -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)