Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CLI help messages. #146

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
22 changes: 11 additions & 11 deletions xbridge_cli/bridge/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,27 @@
"--name",
required=True,
prompt=True,
help="The name of the bridge (used for differentiation purposes).",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these all changed to be action statements?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Active voice is preferred for documentation--even with CLI help messages as far as I'm aware?

help="Name the bridge.",
)
@click.option(
"--bootstrap",
envvar="XCHAIN_CONFIG_DIR",
required=True,
prompt=True,
type=click.Path(exists=True),
help="The filepath to the bootstrap config file.",
help="Specify the filepath to the bootstrap config file.",
)
@click.option(
"--signature-reward",
default="100",
help="The reward for witnesses providing a signature.",
help="The reward for witness servers that provide a signature.",
)
@click.option(
"--funding-seed",
"funding_seed",
help=(
"The master key of an account on the locking chain that can fund accounts on "
"the issuing chain. This is only needed for an XRP-XRP bridge."
"The master key of the account on the locking chain that funds "
"accounts on the issuing chain. This is only needed for XRP-XRP bridges."
),
)
@click.option(
Expand All @@ -85,28 +85,28 @@
"close_ledgers",
default=True,
help=(
"Whether to close ledgers manually (via `ledger_accept`) or wait for ledgers "
"to close automatically. A standalone node requires ledgers to be closed; an "
"external network does not support ledger closing."
"Close ledgers manually with `ledger_accept`, or wait for ledgers "
"to close automatically. Standalone nodes require ledgers to be closed; "
"external networks don't support ledger closing."
),
)
@click.option(
"--fund-locking",
"fund_locking",
is_flag=True,
help="Whether to fund the locking chain accounts from the funding seed.",
help="Fund the locking chain accounts from the funding seed.",
)
@click.option(
"-v",
"--verbose",
help="Whether or not to print more verbose information. Also supports `-vv`.",
help="Print more verbose information. Also supports `-vv`.",
count=True,
)
@click.option(
"-s",
"--silent",
is_flag=True,
help="Whether or not to print no information. Cannot be used with -v.",
help="Print no information. Can't be used with -v.",
)
def setup_bridge(
name: str,
Expand Down
20 changes: 10 additions & 10 deletions xbridge_cli/bridge/create_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
required=True,
prompt=True,
help=(
"Whether funding from the locking chain or the issuing chain. "
"Choose funding from the locking chain or issuing chain. "
"Defaults to the locking chain."
),
)
Expand All @@ -35,15 +35,15 @@
required=True,
prompt=True,
type=str,
help="The bridge across which to create the account.",
help="Specify the bridge to create the account on.",
oeggert marked this conversation as resolved.
Show resolved Hide resolved
)
@click.option(
"--from",
"from_seed",
required=True,
prompt=True,
type=str,
help="The seed of the account that the funds come from.",
help="Specify the account seed that the funds come from.",
oeggert marked this conversation as resolved.
Show resolved Hide resolved
)
@click.option(
"--algorithm",
Expand All @@ -63,31 +63,31 @@
default=None,
type=int,
help=(
"The amount (in XRP) with which to fund the account. Must be greater than the "
"account reserve. Defaults to the account reserve."
"The amount of XRP to fund the account with. This must be greater than "
"the account reserve. Defaults to the account reserve."
),
)
@click.option(
"--close-ledgers/--no-close-ledgers",
"close_ledgers",
default=True,
help=(
"Whether to close ledgers manually (via `ledger_accept`) or wait for ledgers "
"to close automatically. A standalone node requires ledgers to be closed; an "
"external network does not support ledger closing."
"Close ledgers manually with `ledger_accept` or wait for ledgers "
"to close automatically. Standalone nodes requires ledgers to be closed; "
"external networks don't support ledger closing."
),
)
@click.option(
"-v",
"--verbose",
help="Whether or not to print more verbose information. Also supports `-vv`.",
help="Print more verbose information. Also supports `-vv`.",
count=True,
)
@click.option(
"-s",
"--silent",
is_flag=True,
help="Whether or not to print no information. Cannot be used with -v.",
help="Print no information. Can't be used with -v.",
)
def create_xchain_account(
from_locking: bool,
Expand Down
15 changes: 7 additions & 8 deletions xbridge_cli/bridge/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,38 @@ def _get_bootstrap_chain_and_door(chain_json: Dict[str, Any]) -> Tuple[str, str]
"--name",
required=True,
prompt=True,
help="The name of the bridge (used for differentiation purposes).",
help="Name the bridge.",
)
@click.option(
"--bootstrap",
type=click.Path(exists=True),
help=(
"The filepath to the bootstrap config file. Optional. If you don't have it, "
"enter the info by hand."
"(Optional) The filepath of the bootstrap config file."
),
)
@click.option(
"--chains",
nargs=2,
type=str,
help=(
"The URLs for HTTP connections for the two chains that the bridge is between. "
"Must be in the order (locking_chain, issuing_chain)."
"The URLs for HTTP connections to the chains on the bridge. "
"Must be in the order of `locking_chain, issuing_chain`."
),
)
@click.option(
"--doors",
nargs=2,
type=str,
help=(
"The two door accounts. Must be in the order (locking_chain_door, "
"issuing_chain_door)."
"The two door accounts. Must be in the order of `locking_chain_door, "
"issuing_chain_door`."
),
)
@click.option(
"-v",
"--verbose",
is_flag=True,
help="Whether or not to print more verbose information.",
help="Print more verbose information.",
)
def register_bridge(
name: str,
Expand Down
22 changes: 11 additions & 11 deletions xbridge_cli/bridge/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ def _submit_tx(
required=True,
prompt=True,
type=str,
help="The bridge to transfer across.",
help="Specify the transfer bridge.",
)
@click.option(
"--from-locking/--from-issuing",
"from_locking",
required=True,
prompt=True,
help=(
"Whether funding from the locking chain or the issuing chain. "
"Specify if funding comes from the locking chain or the issuing chain. "
oeggert marked this conversation as resolved.
Show resolved Hide resolved
"Defaults to the locking chain."
),
)
Expand All @@ -61,50 +61,50 @@ def _submit_tx(
required=True,
prompt=True,
type=float,
help="The amount to transfer.",
help="Specify the amount to transfer.",
)
@click.option(
"--from",
"from_account",
required=True,
prompt=True,
type=str,
help="The seed of the account to transfer from.",
help="Specify the seed of the account to transfer from.",
)
@click.option(
"--to",
"to_account",
required=True,
prompt=True,
type=str,
help="The seed of the account to transfer to.",
help="Specify the seed of the account to transfer to.",
)
@click.option(
"--close-ledgers/--no-close-ledgers",
"close_ledgers",
default=True,
help=(
"Whether to close ledgers manually (via `ledger_accept`) or wait for ledgers "
"to close automatically. A standalone node requires ledgers to be closed; an "
"external network does not support ledger closing."
"Close ledgers manually with `ledger_accept` or wait for ledgers "
"to close automatically. Standalone nodes requires ledgers to be closed; "
"external networks don't support ledger closing."
),
)
@click.option(
"-v",
"--verbose",
count=True,
help="Whether or not to print more verbose information. Supports `-vv`.",
help="Print more verbose information. Supports `-vv`.",
)
@click.option(
"-s",
"--silent",
is_flag=True,
help="Whether or not to print no information. Cannot be used with -v.",
help="Print no information. Can't be used with -v.",
)
@click.option(
"--tutorial",
is_flag=True,
help="Turn this flag on if you want to slow down and really understand each step.",
help="Enable this flag to slow down and understand each step.",
)
def send_transfer(
bridge: str,
Expand Down
4 changes: 2 additions & 2 deletions xbridge_cli/misc/fund.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
nargs=-1,
)
@click.option(
"--amount", type=int, default=1000, help="The amount to fund each account (in XRP)."
"--amount", type=int, default=1000, help="The amount of XRP to fund each account."
)
@click.option(
"-v",
"--verbose",
is_flag=True,
help="Whether or not to print more verbose information.",
help="Print more verbose information.",
)
def fund_account(
chain: str, accounts: List[str], amount: int = 10000, verbose: bool = False
Expand Down
2 changes: 1 addition & 1 deletion xbridge_cli/misc/trust.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"-v",
"--verbose",
is_flag=True,
help="Whether or not to print more verbose information.",
help="Print more verbose information.",
)
def set_trustline(
chain: str, currency: str, accounts: List[str], verbose: bool = False
Expand Down
20 changes: 10 additions & 10 deletions xbridge_cli/server/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,18 @@ def _generate_rippled_configs(config_dir: str, docker: bool = False) -> Tuple[in
"config_dir",
required=True,
prompt=True,
help="The folder in which to store config files.",
help="Specify the folder to store config files in.",
)
@click.option(
"--name",
default="witness",
help="The name of the witness server. Used for the folder name.",
help="The name of the witness server (also used for the folder name).",
)
@click.option(
"--docker",
"is_docker",
is_flag=True,
help="Whether the config files are for a docker setup.",
help="Specify the config files are for a docker setup.",
)
@click.option(
"--locking-port",
Expand All @@ -150,7 +150,7 @@ def _generate_rippled_configs(config_dir: str, docker: bool = False) -> Tuple[in
required=True,
prompt=True,
type=int,
help="The port that will be used by the witness server.",
help="The port used by the witness server.",
)
@click.option(
"--src-door",
Expand Down Expand Up @@ -188,7 +188,7 @@ def _generate_rippled_configs(config_dir: str, docker: bool = False) -> Tuple[in
"locking_reward_seed",
required=True,
prompt=True,
help="The seed for the reward account for the witness on the locking chain.",
help="The seed of the reward account for the witness on the locking chain.",
)
@click.option(
"--locking-reward-account",
Expand All @@ -202,14 +202,14 @@ def _generate_rippled_configs(config_dir: str, docker: bool = False) -> Tuple[in
"signing_seed",
required=True,
prompt=True,
help="The seed to use for signing attestations.",
help="The seed for signing attestations.",
)
@click.option(
"--issuing-reward-seed",
"issuing_reward_seed",
required=True,
prompt=True,
help="The seed for the reward account for the witness on the issuing chain.",
help="The seed of the reward account for the witness on the issuing chain.",
)
@click.option(
"--issuing-reward-account",
Expand All @@ -222,7 +222,7 @@ def _generate_rippled_configs(config_dir: str, docker: bool = False) -> Tuple[in
"-v",
"--verbose",
is_flag=True,
help="Whether or not to print more verbose information.",
help="Print more verbose information.",
)
def generate_witness_config(
config_dir: str,
Expand Down Expand Up @@ -328,7 +328,7 @@ def generate_witness_config(
"config_dir",
required=True,
prompt=True,
help="The folder in which to store the bridge bootstrap file.",
help="Specify the folder to store the bridge bootstrap file in.",
)
@click.option(
"--locking-seed",
Expand Down Expand Up @@ -393,7 +393,7 @@ def generate_witness_config(
"-v",
"--verbose",
is_flag=True,
help="Whether or not to print more verbose information.",
help="Print more verbose information.",
)
def generate_bootstrap(
config_dir: str,
Expand Down
4 changes: 2 additions & 2 deletions xbridge_cli/server/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"-v",
"--verbose",
is_flag=True,
help="Whether or not to print more verbose information.",
help="Print more verbose information.",
)
def request_server(
name: str, command: str, args: Tuple[str], verbose: bool = False
Expand Down Expand Up @@ -53,7 +53,7 @@ def request_server(

@click.command(name="status")
@click.option("--name", help="The name of the server to query.")
@click.option("--all", is_flag=True, help="Whether to query all of the servers.")
@click.option("--all", is_flag=True, help="Query all of the servers.")
def get_server_status(name: Optional[str] = None, query_all: bool = False) -> None:
"""
Get the status of a rippled or witness node(s).
Expand Down
Loading
Loading