Skip to content

Commit

Permalink
Merge pull request #69 from TheFriendlyCoder/alias_help
Browse files Browse the repository at this point in the history
Fixes #58 Added aliases to help output
  • Loading branch information
TheFriendlyCoder committed May 8, 2018
2 parents 8fa59a8 + 98c167e commit bd03151
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/friendlyshell/shell_help_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ def _list_commands(self):

# Generate our help data
command_list['Command'].append(cmd_name)
alias_method_name = "alias_" + cmd_name
if hasattr(self, alias_method_name):
alias_method = getattr(self, alias_method_name)
command_list['Command'][-1] += \
" ({0})".format(alias_method())

doc_string = inspect.getdoc(method_obj) or ''
doc_string = doc_string.replace("\n", " ")
command_list['Description'].append(doc_string)
Expand All @@ -81,6 +87,7 @@ def _list_commands(self):
else:
command_list['Extended Help'].append('N/A')


wrap_width = self._description_wrap(
command_list['Command'],
command_list['Extended Help'])
Expand Down

0 comments on commit bd03151

Please sign in to comment.