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

Commit

Permalink
improve wallet usage help (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje authored Jan 5, 2019
1 parent e4540d4 commit 90cacd5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion neo/Prompt/CommandBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,15 @@ def __command_with_parents(self):
s = self.__parent_command.__command_with_parents() + " " + s
return s

def _usage_str(self):
return f"Usage: {self.__command_with_parents()} COMMAND"

def handle_help(self, arguments):
item = get_arg(arguments)
if item == 'help':
if len(self.__sub_commands) > 0:
# show overview of subcommands and their purpose
print(f"\nUsage: {self.__command_with_parents()} COMMAND\n")
print(f"\n{self._usage_str()}\n")
print(f"{self.command_desc().short_help.capitalize()}\n")
print("Commands:")

Expand Down
4 changes: 4 additions & 0 deletions neo/Prompt/Commands/Wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def execute(self, arguments):
print(f"{item} is an invalid parameter")
return

def _usage_str(self):
base = super()._usage_str()
return base + " (or \"wallet\" to show the wallet contents)"


class CommandWalletCreate(CommandBase):

Expand Down

0 comments on commit 90cacd5

Please sign in to comment.