From 0f4b454c206b6487207f2f7218232b3916ae45bd Mon Sep 17 00:00:00 2001 From: David Logie Date: Sun, 8 May 2016 16:43:45 +0100 Subject: [PATCH] Don't blow up if a subcommand has no help string. --- beets/ui/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index aeb3b8f52..933026b09 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -989,7 +989,8 @@ class SubcommandsOptionParser(CommonOptionsParser): result.append(name) help_width = formatter.width - help_position help_lines = textwrap.wrap(subcommand.help, help_width) - result.append("%*s%s\n" % (indent_first, "", help_lines[0])) + help_line = help_lines[0] if help_lines else '' + result.append("%*s%s\n" % (indent_first, "", help_line)) result.extend(["%*s%s\n" % (help_position, "", line) for line in help_lines[1:]]) formatter.dedent()