Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion hug/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down