Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.

[refactor-prompt] fix exception in specific help case #792

Merged
merged 1 commit into from
Jan 5, 2019
Merged
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
9 changes: 5 additions & 4 deletions neo/Prompt/CommandBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ def __print_absolute_cmd_help(self):
params += f"{p.formatted_name()} "
print(f"\nUsage: {self.__command_with_parents()} {params}\n")

min_indent = 15
longest_param_name = max(min_indent, max(len(p.name) for p in self.command_desc().params))
for p in self.command_desc().params:
print(p.to_str(longest_param_name))
if len(self.command_desc().params) > 0:
min_indent = 15
longest_param_name = max(min_indent, max(len(p.name) for p in self.command_desc().params))
for p in self.command_desc().params:
print(p.to_str(longest_param_name))

def __command_with_parents(self):
s = self.command_desc().command
Expand Down