diff --git a/hug/api.py b/hug/api.py index 7179c7a4..7a6886d0 100644 --- a/hug/api.py +++ b/hug/api.py @@ -470,9 +470,10 @@ def output_format(self, formatter): def __str__(self): output = "{0}\n\nAvailable Commands:\n\n".format(self.api.doc or self.api.name) + max_length = max((len(command_name) for command_name in self.commands)) for command_name, command in self.commands.items(): command_string = " - {}{}".format( - command_name, ": " + str(command).replace("\n", " ") if str(command) else "" + command_name.ljust(max_length+3), str(command).split('\n')[0] if str(command) else "" ) output += command_string[:77] + "..." if len(command_string) > 80 else command_string output += "\n"