remove_empty_description_od with path
This commit is contained in:
@ -124,9 +124,15 @@ class TiramisuHelpFormatter(HelpFormatter):
|
||||
# Remove OD if name == description
|
||||
if self.items and \
|
||||
self.formatter.remove_empty_description_od and \
|
||||
self.items[0][0].__name__ == '_format_text' and \
|
||||
self.items[0][1][0] == self.heading:
|
||||
return ''
|
||||
self.items[0][0].__name__ == '_format_text':
|
||||
name = self.items[0][1][0]
|
||||
path = self.heading
|
||||
if '.' in path:
|
||||
compare = path.rsplit('.', 1)[1]
|
||||
else:
|
||||
compare = path
|
||||
if name == path:
|
||||
return ''
|
||||
return super().format_help()
|
||||
|
||||
class _TiramisuHelpAction(_HelpAction):
|
||||
|
Reference in New Issue
Block a user