Skip to content
Snippets Groups Projects
Commit 2311cc78 authored by Moul's avatar Moul
Browse files

[mod] #160: examples: Allow to pass files path in f() prompt as arg

Reduce usage message
Add missing exits
parent b22c2320
No related branches found
No related tags found
No related merge requests found
......@@ -21,14 +21,11 @@ import sys
from duniterpy.key import SigningKey
def load_binary_encrypted_message():
def load_binary_encrypted_message(signed_message_path=None):
if not signed_message_path:
if len(sys.argv) < 2:
print(
"""
Usage:
python decrypt_message.py ENCRYPTED_MESSAGE_FILEPATH
"""
)
print("Usage: python decrypt_message.py ENCRYPTED_MESSAGE_FILEPATH")
sys.exit(1)
# capture encrypted message filepath argument
signed_message_path = sys.argv[1]
......
......@@ -19,14 +19,11 @@ import sys
from duniterpy.key import VerifyingKey
def load_binary_signed_message():
def load_binary_signed_message(signed_message_path=None):
if not signed_message_path:
if len(sys.argv) < 2:
print(
"""
Usage:
python verify_signed_message.py SIGNED_MESSAGE_FILEPATH
"""
)
print("Usage: python verify_signed_message.py SIGNED_MESSAGE_FILEPATH")
sys.exit(1)
# capture signed message filepath argument
signed_message_path = sys.argv[1]
......
......@@ -19,7 +19,8 @@ import sys
from duniterpy.key import SigningKey
def load_credentials_file():
def load_credentials_file(credentials_filepath=None):
if not credentials_filepath:
if len(sys.argv) < 2:
print("Usage: python load_credentials_file.py FILEPATH")
sys.exit(1)
......
......@@ -19,7 +19,8 @@ import sys
from duniterpy.key import SigningKey
def load_scuttlebutt_file():
def load_scuttlebutt_file(scuttlebutt_filepath=None):
if not scuttlebutt_filepath:
if len(sys.argv) < 2:
print("Usage: python load_scuttlebutt_file.py FILEPATH")
sys.exit(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment