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

[refactor-prompt] update wallet usage help #794

Merged
merged 1 commit into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion neo/Prompt/CommandBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,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 @@ -69,6 +69,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