diff --git a/silkaj/auth.py b/silkaj/auth.py index c62ff0ffca717f79b522caf793108d5d65e6bd58..ad2a71914dfc5cc4d6d7cfc538d04cb0f39dc8f7 100644 --- a/silkaj/auth.py +++ b/silkaj/auth.py @@ -65,7 +65,7 @@ def auth_options( "--auth-scrypt", "--scrypt", is_flag=True, - help="Scrypt authentication: default method", + help="Scrypt authentication. Default method", cls=tools.MutuallyExclusiveOption, mutually_exclusive=["auth_file", "auth_seed", "auth_wif"], ) @@ -74,7 +74,7 @@ def auth_options( "--auth-file", "-af", type=click.Path(exists=True, dir_okay=False, path_type=Path), - help="Authentication file path", + help="Seed hexadecimal authentication from file path", cls=tools.MutuallyExclusiveOption, mutually_exclusive=["auth_scrypt", "auth_seed", "auth_wif"], ) diff --git a/silkaj/blockchain/difficulty.py b/silkaj/blockchain/difficulty.py index 6576c6cae188523384fe9d6900b67a9e6c13258f..4735c9cec0c790ec4ce071cbf99b8db7b01a45bb 100644 --- a/silkaj/blockchain/difficulty.py +++ b/silkaj/blockchain/difficulty.py @@ -29,7 +29,7 @@ from silkaj.constants import ALL @click.command( "difficulty", - help="Display the current Proof of Work difficulty level to generate the next block", + help="Display current Proof-of-Work difficulty level to generate next block", ) def difficulties() -> None: client = network.client_instance() diff --git a/silkaj/blockchain/information.py b/silkaj/blockchain/information.py index f83083fa0cb4814219687766a86edd0116ac2f6d..d4d8f503ea4f5fcfb0851eb8a480184488f422a5 100644 --- a/silkaj/blockchain/information.py +++ b/silkaj/blockchain/information.py @@ -22,7 +22,7 @@ from silkaj.network import determine_endpoint from silkaj.tools import get_currency_symbol -@click.command("info", help="Display information about currency") +@click.command("info", help="Currency information") def currency_info() -> None: head_block = get_head_block() ep = determine_endpoint() diff --git a/silkaj/checksum.py b/silkaj/checksum.py index 592ab38e97d29e17c46ff81e0bcc3ebcac957413..83e1cd4e6f44fedc45a2a23eebd922f7efe0e9e7 100644 --- a/silkaj/checksum.py +++ b/silkaj/checksum.py @@ -30,8 +30,8 @@ MESSAGE = "You should specify a pubkey or an authentication method" @click.command( "checksum", - help="Generate checksum out of a passed pubkey or an authentication method.\ - Can also check if the checksum is valid", + help="Generate checksum out of a passed pubkey or an authentication method. \ +Checks if the passed checksum is valid.", ) @click.argument("pubkey_checksum", nargs=-1) def checksum_command(pubkey_checksum: str) -> None: diff --git a/silkaj/cli.py b/silkaj/cli.py index 2eff376563aa98640d56f8e0561ec32849a76dd4..cc3b75f6fe106fa137af6f2fd26a7354e83257bb 100644 --- a/silkaj/cli.py +++ b/silkaj/cli.py @@ -18,7 +18,7 @@ import contextlib import rich_click as click from duniterpy.api.endpoint import endpoint as du_endpoint -from silkaj import tools, tui +from silkaj import tools from silkaj.about import about from silkaj.auth import generate_auth_file from silkaj.blockchain.blocks import list_blocks @@ -64,10 +64,9 @@ click.rich_click.OPTION_GROUPS = { @click.option( "--endpoint", "-ep", - help=f"Default endpoint reaches Ğ1 currency on its official endpoint: \ -{tui.endpoint_link(du_endpoint(G1_DEFAULT_ENDPOINT).host)}. \ ---endpoint allows to specify a custom endpoint following the format: <host>:<port>/<path>. \ -<port> and <path> are optional. In case no port is specified, it defaults to 443.", + help=f"Without specifying this option, the default endpoint reaches Ğ1 currency on its official endpoint: https://{du_endpoint(G1_DEFAULT_ENDPOINT).host}. \ +--endpoint allows to specify a custom endpoint following `<host>:<port>/<path>` format. \ +`port` and `path` are optional. In case no port is specified, it defaults to 443.", cls=tools.MutuallyExclusiveOption, mutually_exclusive=["gtest"], ) @@ -75,9 +74,7 @@ click.rich_click.OPTION_GROUPS = { "--gtest", "-gt", is_flag=True, - help=f"Uses official ĞTest currency endpoint: \ -{tui.endpoint_link(du_endpoint(G1_TEST_DEFAULT_ENDPOINT).host)}. \ -Note that --endpoint has precedence over --gtest.", + help=f"Uses official ĞTest currency endpoint: https://{du_endpoint(G1_TEST_DEFAULT_ENDPOINT).host}", cls=tools.MutuallyExclusiveOption, mutually_exclusive=["endpoint"], ) @@ -85,8 +82,7 @@ Note that --endpoint has precedence over --gtest.", "account_name", "--account", "-a", - help="Account name used in storage $HOME/.local/share/silkaj/$currency/$account_name \ -for authentication and revocation", + help="Account name used in storage `$HOME/.local/share/silkaj/$currency/$account_name` for authentication and revocation.", ) @click.option( "--password", @@ -105,8 +101,7 @@ In case of an encrypted file, password input will be prompted.", "--dry-run", "-n", is_flag=True, - help="By-pass licence, confirmation. \ -Do not send the document, but display it instead", + help="By-pass the licence and confirmation. Do not send the document, but display it instead", ) @click.pass_context def cli( @@ -174,11 +169,7 @@ wot_group.add_command(send_membership) wot_group.add_command(status) -@wot_group.group( - "revocation", - help="Create, save, verify or publish revocation document.\n\ -Subcommands optionally take the path to the revocation document.", -) +@wot_group.group("revocation", help="Manage revocation document commands.") def revocation_group() -> None: pass diff --git a/silkaj/money/balance.py b/silkaj/money/balance.py index 6a69ccfedc57c974f4db4f063b0a07d01e16b142..f69b884bad0e485fc3bdfbd9a79e81e586232fad 100644 --- a/silkaj/money/balance.py +++ b/silkaj/money/balance.py @@ -25,7 +25,10 @@ from silkaj.public_key import gen_pubkey_checksum, is_pubkey_and_check from silkaj.wot import tools as wt -@click.command("balance", help="Get wallet balance") +@click.command( + "balance", + help="Wallet·s balance·s. Multiple public keys can be passed, then a sum is computed. Also works with the authentication.", +) @click.argument("pubkeys", nargs=-1) @click.pass_context def balance_cmd(ctx: click.Context, pubkeys: str) -> None: diff --git a/silkaj/money/history.py b/silkaj/money/history.py index 216ae5882a4f072e4b1872462af8c362dac5d598..3e6521e4215e0cb493aea21ab330e48c69f5f66f 100644 --- a/silkaj/money/history.py +++ b/silkaj/money/history.py @@ -39,10 +39,12 @@ from silkaj.tui import Table from silkaj.wot import tools as wt -@click.command("history", help="Display transaction history") +@click.command("history", help="History of wallet money movements") @click.argument("pubkey") -@click.option("--uids", "-u", is_flag=True, help="Display uids") -@click.option("--full-pubkey", "-f", is_flag=True, help="Display full-length pubkeys") +@click.option("--uids", "-u", is_flag=True, help="Display identities usernames") +@click.option( + "--full-pubkey", "-f", is_flag=True, help="Display full-length public keys" +) @click.option( "--csv-file", "--csv", diff --git a/silkaj/money/transfer.py b/silkaj/money/transfer.py index 0dabcecc5b703206712029c25eb924c468507019..f2a2bed115dc27f2190e1b600a5712cee40748e5 100644 --- a/silkaj/money/transfer.py +++ b/silkaj/money/transfer.py @@ -68,7 +68,7 @@ NBR_ISSUERS = 1 "-a", multiple=True, type=click.FloatRange(MINIMAL_ABSOLUTE_TX_AMOUNT), - help=f"Quantitative amount(s):\n-a <amount>\nMinimum amount is {MINIMAL_ABSOLUTE_TX_AMOUNT}.", + help="Quantitative amount(s).", cls=tools.MutuallyExclusiveOption, mutually_exclusive=["amountsud", "allsources", "file_path"], ) @@ -78,14 +78,14 @@ NBR_ISSUERS = 1 "-d", multiple=True, type=click.FloatRange(MINIMAL_RELATIVE_TX_AMOUNT), - help=f"Relative amount(s):\n-d <amount_UD>\nMinimum amount is {MINIMAL_RELATIVE_TX_AMOUNT}", + help="Relative amount(s).", cls=tools.MutuallyExclusiveOption, mutually_exclusive=["amounts", "allsources", "file_path"], ) @click.option( "--allSources", is_flag=True, - help="Send all sources to one recipient", + help="Send all sources to one recipient.", cls=tools.MutuallyExclusiveOption, mutually_exclusive=["amounts", "amountsud", "file_path"], ) @@ -94,10 +94,10 @@ NBR_ISSUERS = 1 "--recipient", "-r", multiple=True, - help="Pubkey(s)` recipients + optional checksum:\n-r <pubkey>[:checksum]\n\ -Sending to many recipients is possible:\n\ -* With one amount, all will receive the amount\n\ -* With many amounts (one per recipient)", + help="Public key(s)' recipients + optional checksum: `<pubkey>[:checksum]`. \ +Sending to multiple recipients is possible. \ +With one amount specified, all recipients will receive the same amount. \ +With one amount specified per recipient, recipient 1 will recieve amount 1, and so on.", cls=tools.MutuallyExclusiveOption, mutually_exclusive=["file_path"], ) @@ -106,15 +106,15 @@ Sending to many recipients is possible:\n\ "--file", "-f", type=click.Path(exists=True, dir_okay=False, path_type=Path), - help="File`s path containing a list of amounts in absolute or \ -relative reference and recipients` pubkeys", + help="File's path containing a list of amounts in absolute or \ +relative reference and recipients' pubkeys", cls=tools.MutuallyExclusiveOption, mutually_exclusive=["recipients", "amounts", "amountsUD", "allsources"], ) @click.option("--comment", "-c", default="", help="Comment") @click.option( "--outputBackChange", - help="Pubkey recipient to send the rest of the transaction: <pubkey[:checksum]>", + help="Pubkey recipient to send the rest of the transaction: `<pubkey[:checksum]>`", ) @click.option( "--yes", diff --git a/silkaj/tui.py b/silkaj/tui.py index 421fa2b068f9b2c59e6d88d26ad774acaa614e8e..db9384ac2f5ceeddcb598ae3ee641094551aae6f 100644 --- a/silkaj/tui.py +++ b/silkaj/tui.py @@ -25,10 +25,6 @@ from silkaj import constants VERT_TABLE_CHARS = ["─", "│", "│", "═"] -def endpoint_link(endpoint_host: str) -> str: - return f"https://{endpoint_host}/node/summary" - - def send_doc_confirmation(document_name: str) -> None: if not click.confirm(f"Do you confirm sending this {document_name}?"): sys.exit(constants.SUCCESS_EXIT_STATUS) diff --git a/silkaj/wot/certify.py b/silkaj/wot/certify.py index d055819bc11c480f9ec38bb7b5d2d16aa0e54139..acf187f31bc41f50dbb6d3758b282dc3561ee821 100644 --- a/silkaj/wot/certify.py +++ b/silkaj/wot/certify.py @@ -32,7 +32,7 @@ from silkaj.public_key import gen_pubkey_checksum, is_pubkey_and_check from silkaj.wot import tools as wot_tools -@click.command("certify", help="Send certification") +@click.command("certify", help="Certify identity") @click.argument("uid_pubkey_to_certify") @click.pass_context def certify(ctx: click.Context, uid_pubkey_to_certify: str) -> None: diff --git a/silkaj/wot/exclusions.py b/silkaj/wot/exclusions.py index 2cf8c256478ee4d7717815d35a8cc2cd386cb6c7..ed5d5e844c11fdef68c7068547ad62a979bbc05f 100644 --- a/silkaj/wot/exclusions.py +++ b/silkaj/wot/exclusions.py @@ -64,13 +64,13 @@ markdown formatted and publish them on Discourse Forums", @click.option( "-ml", "--ml-forum-api-key", - help="API key used for Monnaie Libre Forum", + help="API key used on Monnaie Libre Forum", ) @click.argument("days", default=1, type=click.FloatRange(0, 50)) @click.option( "--publish", is_flag=True, - help="Publish the messages on the forums, otherwise print them", + help="Publish the messages on the forums, otherwise they will be printed here.", ) def exclusions_command(api_id, duniter_forum_api_key, ml_forum_api_key, days, publish): params = get_blockchain_parameters() diff --git a/silkaj/wot/lookup.py b/silkaj/wot/lookup.py index 62537082f5ce34f2fa6ef8336ba7c80bdc9acf52..aa18c566003af9ac9f6d065fadd6e87c387856a5 100644 --- a/silkaj/wot/lookup.py +++ b/silkaj/wot/lookup.py @@ -22,7 +22,7 @@ from silkaj.public_key import gen_pubkey_checksum, is_pubkey_and_check from silkaj.wot import tools as wt -@click.command("lookup", help="User identifier and public key lookup") +@click.command("lookup", help="Username identifier and public key lookup") @click.argument("uid_pubkey") def lookup_cmd(uid_pubkey: str) -> None: checked_pubkey = is_pubkey_and_check(uid_pubkey) diff --git a/silkaj/wot/membership.py b/silkaj/wot/membership.py index 4dfed3b0f36e28a6bdf2dbdea8389c4999299439..92f7013d7d654df0486a3fd3342dc48b98c0ffa5 100644 --- a/silkaj/wot/membership.py +++ b/silkaj/wot/membership.py @@ -30,11 +30,7 @@ from silkaj.public_key import gen_pubkey_checksum from silkaj.wot import tools as w_tools -@click.command( - "membership", - help="Send and sign membership document:\n\ -for first emission and for renewal", -) +@click.command("membership", help="Send or renew membership.") @click.pass_context def send_membership(ctx: click.Context) -> None: dry_run = ctx.obj["DRY_RUN"] diff --git a/silkaj/wot/revocation.py b/silkaj/wot/revocation.py index c3e5ecb9d15d5f26e1f7b5527678f0594f27382a..a1cd8c0fa614f807ba7b196daa1cabdd7da510e6 100644 --- a/silkaj/wot/revocation.py +++ b/silkaj/wot/revocation.py @@ -34,7 +34,7 @@ from silkaj.wot import idty_tools from silkaj.wot import tools as w_tools -@click.command("create", help="Create and save a revocation document") +@click.command("create", help="Create and save revocation document") def create() -> None: currency = bc_tools.get_currency() @@ -58,7 +58,7 @@ def create() -> None: @click.command( "revoke", - help="Create and publish revocation document. Will revoke the identity immediately.", + help="Create and publish revocation document. Will immediately revoke the identity.", ) @click.pass_context def revoke_now(ctx: click.Context) -> None: @@ -87,7 +87,7 @@ def revoke_now(ctx: click.Context) -> None: @click.command( "verify", - help="Verifies that a revocation document is correctly formatted and matches an existing identity", + help="Verifies that the revocation document is correctly formatted and matches an existing identity", ) def verify() -> None: revocation_file_path = AccountStorage().revocation_path() @@ -99,7 +99,7 @@ def verify() -> None: @click.command( "publish", - help="Publish revocation document. Identity will be revoked immediately", + help="Publish previously created revocation document. Identity will be immediately revoked.", ) @click.pass_context def publish(ctx: click.Context) -> None: