Add newline after multimatch string error message

Other utility functions, such as caller.msg(), don't require adding
newline because newlines are added implicitly.  This change modifies the
multimatch string parameter to also not require newline, but add one
implicitly.
This commit is contained in:
bclack 2017-10-21 14:46:18 -05:00 committed by Griatch
parent 6b4ce9eb2a
commit f356b6b6d3

View file

@ -1786,8 +1786,12 @@ def at_search_result(matches, caller, query="", quiet=False, **kwargs):
error = kwargs.get("nofound_string") or _("Could not find '%s'." % query)
matches = None
elif len(matches) > 1:
error = kwargs.get("multimatch_string") or \
_("More than one match for '%s' (please narrow target):\n" % query)
multimatch_string = kwargs.get("multimatch_string")
if multimatch_string:
error = "%s\n" % multimatch_string
else:
error = _("More than one match for '%s' (please narrow target):\n" % query)
for num, result in enumerate(matches):
# we need to consider Commands, where .aliases is a list
aliases = result.aliases.all() if hasattr(result.aliases, "all") else result.aliases