diff --git a/.changelog/unreleased/improvements/3226-cli-line-wrapping.md b/.changelog/unreleased/improvements/3226-cli-line-wrapping.md new file mode 100644 index 0000000000..fd3a25c705 --- /dev/null +++ b/.changelog/unreleased/improvements/3226-cli-line-wrapping.md @@ -0,0 +1,3 @@ +- Extends claps Arg and Command types with namada traits. These add configurable line wrapping and + hyphenation policies. Also sets help to always be on the next line, but this is easily changeable later. + ([\#3226](https://github.com/anoma/namada/issues/3226)) \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index d1b6d11a52..f967862c68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4622,6 +4622,7 @@ dependencies = [ "tendermint-config", "tendermint-rpc", "test-log", + "textwrap-macros", "thiserror", "tokio", "tokio-test", @@ -6215,6 +6216,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro2" version = "1.0.78" @@ -7401,6 +7408,12 @@ version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + [[package]] name = "smooth-operator" version = "0.6.0" @@ -7873,6 +7886,39 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "textwrap-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "975e7e5fec79db404c3f07c9182d1c4450d5e2c68340be6b5a7140f48b276a30" +dependencies = [ + "proc-macro-hack", + "textwrap-macros-impl", +] + +[[package]] +name = "textwrap-macros-impl" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32379e128f71c85438e4086388c6321232b64cd7e8560e2c2431d9bfc51fc3cc" +dependencies = [ + "proc-macro-hack", + "quote", + "syn 1.0.109", + "textwrap", +] + [[package]] name = "thiserror" version = "1.0.50" @@ -8509,6 +8555,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + [[package]] name = "unicode-normalization" version = "0.1.22" diff --git a/crates/apps/Cargo.toml b/crates/apps/Cargo.toml index 4388c53f2f..9df863496a 100644 --- a/crates/apps/Cargo.toml +++ b/crates/apps/Cargo.toml @@ -144,6 +144,7 @@ tar.workspace = true tempfile.workspace = true tendermint-config.workspace = true tendermint-rpc.workspace = true +textwrap-macros = "0.3.0" thiserror.workspace = true tokio = {workspace = true, features = ["full"]} toml.workspace = true diff --git a/crates/apps/src/lib/cli.rs b/crates/apps/src/lib/cli.rs index ec299c7c9e..c2d66e5378 100644 --- a/crates/apps/src/lib/cli.rs +++ b/crates/apps/src/lib/cli.rs @@ -33,11 +33,11 @@ const WALLET_CMD: &str = "wallet"; const RELAYER_CMD: &str = "relayer"; pub mod cmds { - use super::utils::*; use super::{ args, ArgMatches, CLIENT_CMD, NODE_CMD, RELAYER_CMD, WALLET_CMD, }; + use crate::wrap; /// Commands for `namada` binary. #[allow(clippy::large_enum_variant)] @@ -148,7 +148,7 @@ pub mod cmds { fn def() -> App { ::add_sub( App::new(Self::CMD) - .about("Node sub-commands.") + .about(wrap!("Node sub-commands.")) .subcommand_required(true) .arg_required_else_help(true), ) @@ -190,7 +190,7 @@ pub mod cmds { fn def() -> App { ::add_sub( App::new(Self::CMD) - .about("Relayer sub-commands.") + .about(wrap!("Relayer sub-commands.")) .subcommand_required(true), ) } @@ -428,7 +428,7 @@ pub mod cmds { fn def() -> App { ::add_sub( App::new(Self::CMD) - .about("Client sub-commands.") + .about(wrap!("Client sub-commands.")) .subcommand_required(true) .arg_required_else_help(true), ) @@ -565,7 +565,7 @@ pub mod cmds { fn def() -> App { ::add_sub( App::new(Self::CMD) - .about("Wallet sub-commands.") + .about(wrap!("Wallet sub-commands.")) .subcommand_required(true) .arg_required_else_help(true), ) @@ -589,16 +589,18 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Generates a new transparent / shielded secret key.") - .long_about( + .about(wrap!( + "Generates a new transparent / shielded secret key." + )) + .long_about(wrap!( "In the transparent setting, generates a keypair with a \ given alias and derives the implicit address from its \ public key. The address will be stored with the same \ alias.\nIn the shielded setting, generates a new \ spending key with a given alias.\nIn both settings, by \ default, an HD-key with a default derivation path is \ - generated, with a random mnemonic code.", - ) + generated, with a random mnemonic code." + )) .add_args::() } } @@ -620,19 +622,19 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Derive transparent / shielded key from the mnemonic code \ - or a seed stored on the hardware wallet device.", - ) - .long_about( + or a seed stored on the hardware wallet device." + )) + .long_about(wrap!( "In the transparent setting, derives a keypair from the \ given mnemonic code and HD derivation path and derives \ the implicit address from its public key. Stores the \ keypair and the address with the given alias.\nIn the \ shielded setting, derives a spending key.\nA hardware \ wallet can be used, in which case the private key is not \ - derivable.", - ) + derivable." + )) .add_args::() } } @@ -652,12 +654,12 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("List known keys and addresses in the wallet.") - .long_about( + .about(wrap!("List known keys and addresses in the wallet.")) + .long_about(wrap!( "In the transparent setting, list known keypairs and \ addresses.\nIn the shielded setting, list known spending \ - / viewing keys and payment addresses.", - ) + / viewing keys and payment addresses." + )) .add_args::() } } @@ -677,15 +679,15 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Find known keys and addresses in the wallet.") - .long_about( + .about(wrap!("Find known keys and addresses in the wallet.")) + .long_about(wrap!( "In the transparent setting, searches for a keypair / \ address by a given alias, public key, or a public key \ hash. Looks up an alias of the given address.\nIn the \ shielded setting, searches for a spending / viewing key \ and payment address by a given alias. Looks up an alias \ - of the given payment address.", - ) + of the given payment address." + )) .add_args::() } } @@ -705,10 +707,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Exports a transparent keypair / shielded spending key to \ - a file.", - ) + a file." + )) .add_args::() } } @@ -728,10 +730,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Convert to tendermint priv_validator_key.json with your \ - consensus key alias", - ) + consensus key alias" + )) .add_args::() } } @@ -751,10 +753,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Imports a transparent keypair / shielded spending key \ - from a file.", - ) + from a file." + )) .add_args::() } } @@ -774,7 +776,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Adds the given key or address to the wallet.") + .about(wrap!("Adds the given key or address to the wallet.")) .add_args::() } } @@ -794,10 +796,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Remove the given alias and all associated keys / \ - addresses from the wallet.", - ) + addresses from the wallet." + )) .add_args::() } } @@ -817,9 +819,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( - "Generates a payment address from the given spending key.", - ) + .about(wrap!( + "Generates a payment address from the given spending key." + )) .add_args::>() } } @@ -862,10 +864,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Ledger node sub-commands. If no sub-command specified, \ - defaults to run the node.", - ) + defaults to run the node." + )) .subcommand(LedgerRun::def()) .subcommand(LedgerRunUntil::def()) .subcommand(LedgerReset::def()) @@ -890,7 +892,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Run Namada ledger node.") + .about(wrap!("Run Namada ledger node.")) .add_args::() } } @@ -909,10 +911,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Run Namada ledger node until a given height. Then halt \ - or suspend.", - ) + or suspend." + )) .add_args::() } } @@ -928,10 +930,10 @@ pub mod cmds { } fn def() -> App { - App::new(Self::CMD).about( + App::new(Self::CMD).about(wrap!( "Delete Namada ledger node's and Tendermint node's storage \ - data.", - ) + data." + )) } } @@ -949,7 +951,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Dump Namada ledger node's DB from a block into a file.") + .about(wrap!( + "Dump Namada ledger node's DB from a block into a file." + )) .add_args::() } } @@ -968,11 +972,11 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Applies a set of updates to the DB for hard forking. The \ input should be a path to a file dictating a set of keys \ - and their new values. Can be dry-run for testing.", - ) + and their new values. Can be dry-run for testing." + )) .add_args::() } } @@ -991,10 +995,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Query the value of keys from the DB while the ledger is \ - not running.", - ) + not running." + )) .add_args::() } } @@ -1010,12 +1014,12 @@ pub mod cmds { } fn def() -> App { - App::new(Self::CMD).about( + App::new(Self::CMD).about(wrap!( "Roll Namada state back to the previous height. This command \ does not create a backup of neither the Namada nor the \ Tendermint state before execution: for extra safety, it is \ - recommended to make a backup in advance.", - ) + recommended to make a backup in advance." + )) } } @@ -1041,7 +1045,7 @@ pub mod cmds { App::new(Self::CMD) .subcommand_required(true) .arg_required_else_help(true) - .about("Configuration sub-commands.") + .about(wrap!("Configuration sub-commands.")) .subcommand(ConfigGen::def()) .subcommand(LocalConfig::def()) } @@ -1059,7 +1063,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Generate the default configuration file.") + .about(wrap!("Generate the default configuration file.")) } } @@ -1077,7 +1081,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Update the validator's local configuration.") + .about(wrap!("Update the validator's local configuration.")) .add_args::() } } @@ -1096,7 +1100,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query the result of a transaction.") + .about(wrap!("Query the result of a transaction.")) .add_args::>() } } @@ -1118,7 +1122,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query votes for the proposal.") + .about(wrap!("Query votes for the proposal.")) .arg_required_else_help(true) .add_args::>() } @@ -1141,7 +1145,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query proposals.") + .about(wrap!("Query proposals.")) .add_args::>() } } @@ -1165,7 +1169,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query proposals result.") + .about(wrap!("Query proposals result.")) .add_args::>() } } @@ -1191,7 +1195,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query protocol parameters.") + .about(wrap!("Query protocol parameters.")) .add_args::>() } } @@ -1213,7 +1217,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query pgf stewards and continuous funding.") + .about(wrap!("Query pgf stewards and continuous funding.")) .add_args::>() } } @@ -1232,7 +1236,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Send a transaction with custom WASM code.") + .about(wrap!("Send a transaction with custom WASM code.")) .add_args::>() } } @@ -1251,7 +1255,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Send a signed transfer transaction.") + .about(wrap!("Send a signed transfer transaction.")) .add_args::>() } } @@ -1270,7 +1274,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Send a signed IBC transfer transaction.") + .about(wrap!("Send a signed IBC transfer transaction.")) .add_args::>() } } @@ -1289,10 +1293,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Send a signed transaction to update account's validity \ - predicate.", - ) + predicate." + )) .add_args::>() } } @@ -1311,10 +1315,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Send a signed transaction to create a new established \ - account.", - ) + account." + )) .add_args::>() } } @@ -1333,7 +1337,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Send a signed transaction to become a validator.") + .about(wrap!( + "Send a signed transaction to become a validator." + )) .add_args::>() } } @@ -1352,10 +1358,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Send a signed transaction to create an established \ - account and then become a validator.", - ) + account and then become a validator." + )) .add_args::>() } } @@ -1374,9 +1380,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( - "Send a signed transaction to unjail a jailed validator.", - ) + .about(wrap!( + "Send a signed transaction to unjail a jailed validator." + )) .add_args::>() } } @@ -1399,7 +1405,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Send a signed transaction to deactivate a validator.") + .about(wrap!( + "Send a signed transaction to deactivate a validator." + )) .add_args::>() } } @@ -1422,10 +1430,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Send a signed transaction to reactivate an inactive \ - validator.", - ) + validator." + )) .add_args::>() } } @@ -1444,11 +1452,11 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Sync the local shielded context with MASP notes owned by \ the provided viewing / spending keys up to an optional \ - specified block height.", - ) + specified block height." + )) .add_args::>() } } @@ -1467,7 +1475,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Bond tokens in PoS system.") + .about(wrap!("Bond tokens in PoS system.")) .add_args::>() } } @@ -1486,7 +1494,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Unbond tokens from a PoS bond.") + .about(wrap!("Unbond tokens from a PoS bond.")) .add_args::>() } } @@ -1505,7 +1513,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Withdraw tokens from previously unbonded PoS bond.") + .about(wrap!( + "Withdraw tokens from previously unbonded PoS bond." + )) .add_args::>() } } @@ -1524,10 +1534,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Claim available rewards tokens from bonds that \ - contributed in consensus.", - ) + contributed in consensus." + )) .add_args::>() } } @@ -1546,9 +1556,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( - "Redelegate bonded tokens from one validator to another.", - ) + .about(wrap!( + "Redelegate bonded tokens from one validator to another." + )) .add_args::>() } } @@ -1567,7 +1577,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query the epoch of the last committed block.") + .about(wrap!("Query the epoch of the last committed block.")) .add_args::>() } } @@ -1586,10 +1596,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Query some info to help discern when the next epoch will \ - begin.", - ) + begin." + )) .add_args::>() } } @@ -1608,7 +1618,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query the node's status.") + .about(wrap!("Query the node's status.")) .add_args::>() } } @@ -1627,10 +1637,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Query the substorage space of a specific enstablished \ - address.", - ) + address." + )) .add_args::>() } } @@ -1649,7 +1659,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query currently applicable conversions.") + .about(wrap!("Query currently applicable conversions.")) .add_args::>() } } @@ -1668,10 +1678,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Query the tokens which can earn MASP rewards while \ - shielded.", - ) + shielded." + )) .add_args::>() } } @@ -1690,7 +1700,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query the last committed block.") + .about(wrap!("Query the last committed block.")) .add_args::>() } } @@ -1709,7 +1719,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query the token balance of some account.") + .about(wrap!("Query the token balance of some account.")) .add_args::>() } } @@ -1728,7 +1738,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query PoS bond(s).") + .about(wrap!("Query PoS bond(s).")) .add_args::>() } } @@ -1747,7 +1757,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query PoS bonded stake.") + .about(wrap!("Query PoS bonded stake.")) .add_args::>() } } @@ -1766,7 +1776,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Sign a transaction offline.") + .about(wrap!("Sign a transaction offline.")) .add_args::>() } } @@ -1787,7 +1797,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query the state of a PoS validator.") + .about(wrap!("Query the state of a PoS validator.")) .add_args::>() } } @@ -1808,7 +1818,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query a validator's commission rate.") + .about(wrap!("Query a validator's commission rate.")) .add_args::>() } } @@ -1827,7 +1837,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query a validator's metadata.") + .about(wrap!("Query a validator's metadata.")) .add_args::>() } } @@ -1849,7 +1859,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query PoS applied slashes.") + .about(wrap!("Query PoS applied slashes.")) .add_args::>() } } @@ -1868,10 +1878,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Query the latest rewards available to claim for a given \ - delegation (or self-bond).", - ) + delegation (or self-bond)." + )) .add_args::>() } } @@ -1893,7 +1903,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Find PoS delegations from the given owner address.") + .about(wrap!( + "Find PoS delegations from the given owner address." + )) .add_args::>() } } @@ -1915,10 +1927,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Find a PoS validator and its consensus key by its native \ - address or Tendermint address.", - ) + address or Tendermint address." + )) .add_args::>() } } @@ -1937,7 +1949,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Query the raw bytes of a given storage key") + .about(wrap!("Query the raw bytes of a given storage key")) .add_args::>() } } @@ -1959,7 +1971,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Create a new proposal.") + .about(wrap!("Create a new proposal.")) .add_args::>() } } @@ -1985,7 +1997,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Update how steward commissions are split.") + .about(wrap!("Update how steward commissions are split.")) .add_args::>() } } @@ -2007,7 +2019,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Craft a transaction to resign as a steward.") + .about(wrap!("Craft a transaction to resign as a steward.")) .add_args::>() } } @@ -2033,7 +2045,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Change commission rate.") + .about(wrap!("Change commission rate.")) .add_args::>() } } @@ -2055,10 +2067,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Change validator's metadata, including the commission \ - rate if desired.", - ) + rate if desired." + )) .add_args::>() } } @@ -2082,7 +2094,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Change consensus key.") + .about(wrap!("Change consensus key.")) .add_args::>() } } @@ -2104,7 +2116,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Vote a proposal.") + .about(wrap!("Vote a proposal.")) .add_args::>() } } @@ -2126,15 +2138,15 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Submit a tx to reveal the public key an implicit \ account. Typically, you don't have to do this manually \ and the client will detect when a tx to reveal PK is \ needed and submit it automatically. This will write the \ PK into the account's storage so that it can be used for \ signature verification on transactions authorized by \ - this account.", - ) + this account." + )) .add_args::>() } } @@ -2153,10 +2165,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Query for the current epoch, then sleep until the next \ - epoch.", - ) + epoch." + )) .add_args::>() } } @@ -2230,7 +2242,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Utilities.") + .about(wrap!("Utilities.")) .subcommand(JoinNetwork::def()) .subcommand(ValidateWasm::def()) .subcommand(InitNetwork::def()) @@ -2264,7 +2276,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Configure Namada to join an existing network.") + .about(wrap!("Configure Namada to join an existing network.")) .add_args::() } } @@ -2283,10 +2295,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Check that the provided wasm code is valid by the Namada \ - standards.", - ) + standards." + )) .add_args::() } } @@ -2305,7 +2317,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Initialize a new test network.") + .about(wrap!("Initialize a new test network.")) .add_args::() } } @@ -2324,7 +2336,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Derive account addresses from a genesis txs toml file.") + .about(wrap!( + "Derive account addresses from a genesis txs toml file." + )) .add_args::() } } @@ -2345,9 +2359,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( - "Initialize an established account available at genesis.", - ) + .about(wrap!( + "Initialize an established account available at genesis." + )) .add_args::() } } @@ -2366,7 +2380,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Bond to a validator at pre-genesis.") + .about(wrap!("Bond to a validator at pre-genesis.")) .add_args::() } } @@ -2385,12 +2399,12 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Initialize genesis validator's address, consensus key \ and validator account key and use it in the ledger's \ node. Appends validator creation and self-bond txs to a \ - .toml file containing an established account tx.", - ) + .toml file containing an established account tx." + )) .add_args::() } } @@ -2409,7 +2423,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Validate genesis templates.") + .about(wrap!("Validate genesis templates.")) .add_args::() } } @@ -2428,10 +2442,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Dry run genesis files and get a report on problems that \ - may be found.", - ) + may be found." + )) .add_args::() } } @@ -2450,7 +2464,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Sign genesis transaction(s).") + .about(wrap!("Sign genesis transaction(s).")) .add_args::() } } @@ -2469,7 +2483,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Parse and print a migration JSON file.") + .about(wrap!("Parse and print a migration JSON file.")) .add_args::() } } @@ -2570,11 +2584,11 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Functionality for interacting with the Ethereum bridge \ pool. This pool holds transfers waiting to be relayed to \ - Ethereum.", - ) + Ethereum." + )) .subcommand_required(true) .subcommand(ConstructProof::def().display_order(1)) .subcommand(RecommendBatch::def().display_order(1)) @@ -2599,7 +2613,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Add a new transfer to the Ethereum Bridge pool.") + .about(wrap!("Add a new transfer to the Ethereum Bridge pool.")) .arg_required_else_help(true) .add_args::>() } @@ -2619,10 +2633,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Construct a merkle proof that the given transfers are in \ - the pool.", - ) + the pool." + )) .arg_required_else_help(true) .add_args::>() } @@ -2642,10 +2656,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Construct a merkle proof that the given transfers are in \ - the pool and relay it to Ethereum.", - ) + the pool and relay it to Ethereum." + )) .arg_required_else_help(true) .add_args::>() } @@ -2665,10 +2679,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Get a recommended batch of transfers from the bridge \ - pool to relay to Ethereum.", - ) + pool to relay to Ethereum." + )) .arg_required_else_help(true) .add_args::>() } @@ -2688,7 +2702,7 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Get the contents of the Ethereum Bridge pool.") + .about(wrap!("Get the contents of the Ethereum Bridge pool.")) .add_args::>() } } @@ -2707,10 +2721,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Get the contents of the Ethereum Bridge pool with a \ - signed Merkle root.", - ) + signed Merkle root." + )) .add_args::>() } } @@ -2729,7 +2743,9 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about("Get the confirmation status of transfers to Ethereum.") + .about(wrap!( + "Get the confirmation status of transfers to Ethereum." + )) .add_args::>() } } @@ -2775,11 +2791,11 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Validator set queries, that return data in a format to \ be consumed by the Namada Ethereum bridge smart \ - contracts.", - ) + contracts." + )) .subcommand_required(true) .subcommand(BridgeValidatorSet::def().display_order(1)) .subcommand(GovernanceValidatorSet::def().display_order(1)) @@ -2802,10 +2818,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Query the Bridge validator set in Namada, at the given \ - epoch, or the latest one, if none is provided.", - ) + epoch, or the latest one, if none is provided." + )) .add_args::>() } } @@ -2826,10 +2842,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Query the Governance validator set in Namada, at the \ - given epoch, or the latest one, if none is provided.", - ) + given epoch, or the latest one, if none is provided." + )) .add_args::>() } } @@ -2848,11 +2864,11 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Query an Ethereum ABI encoding of a proof of the \ consensus validator set in Namada, at the requested \ - epoch, or the next one, if no epoch is provided.", - ) + epoch, or the next one, if no epoch is provided." + )) .add_args::>() } } @@ -2873,10 +2889,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Relay a validator set update to Namada's Ethereum bridge \ - smart contracts.", - ) + smart contracts." + )) .add_args::>() } } @@ -2895,10 +2911,10 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Convert a validator's consensus public key to a \ - Tendermint address.", - ) + Tendermint address." + )) .add_args::() } } @@ -2917,11 +2933,11 @@ pub mod cmds { fn def() -> App { App::new(Self::CMD) - .about( + .about(wrap!( "Print the default base directory that would be used if \ --base-dir or NAMADA_BASE_DIR were not used to set the \ - base directory.", - ) + base directory." + )) .add_args::() } } @@ -2970,6 +2986,7 @@ pub mod args { use crate::config::{self, Action, ActionAtHeight}; use crate::facade::tendermint::Timeout; use crate::facade::tendermint_rpc::Url; + use crate::wrap; pub const ADDRESS: Arg = arg("address"); pub const ADD_PERSISTENT_PEERS: ArgFlag = flag("add-persistent-peers"); @@ -3107,9 +3124,11 @@ pub mod args { pub const HISTORIC: ArgFlag = flag("historic"); pub const IBC_TRANSFER_MEMO_PATH: ArgOpt = arg_opt("memo-path"); pub const INPUT_OPT: ArgOpt = arg_opt("input"); - pub const LEDGER_ADDRESS_ABOUT: &str = + pub const LEDGER_ADDRESS_ABOUT: &str = textwrap_macros::fill!( "Address of a ledger node as \"{scheme}://{host}:{port}\". If the \ - scheme is not supplied, it is assumed to be TCP."; + scheme is not supplied, it is assumed to be TCP.", + 60 + ); pub const CONFIG_RPC_LEDGER_ADDRESS: ArgDefaultFromCtx = arg_default_from_ctx("node", DefaultFn(|| "".to_string())); @@ -3265,28 +3284,34 @@ pub mod args { /// Add global args definition. Should be added to every top-level /// command. pub fn def(app: App) -> App { - app.arg(CHAIN_ID_OPT.def().global(true).help("The chain ID.")) - .arg(BASE_DIR.def().global(true).help( + app.next_line_help(true) + .arg( + CHAIN_ID_OPT + .def() + .global(true) + .help(wrap!("The chain ID.")), + ) + .arg(BASE_DIR.def().global(true).help(wrap!( "The base directory is where the nodes, client and wallet \ configuration and state is stored. This value can also \ be set via `NAMADA_BASE_DIR` environment variable, but \ the argument takes precedence, if specified. Defaults to \ `$XDG_DATA_HOME/namada` (`$HOME/.local/share/namada` \ where `XDG_DATA_HOME` is unset) on \ - Unix,`$HOME/Library/Application Support/Namada` on \ - Mac,and `%AppData%\\Namada` on Windows.", - )) - .arg(WASM_DIR.def().global(true).help( + Unix,`$HOME/Library/Application Support/Namada` on Mac, \ + and `%AppData%\\Namada` on Windows." + ))) + .arg(WASM_DIR.def().global(true).help(wrap!( "Directory with built WASM validity predicates, \ transactions. This value can also be set via \ `NAMADA_WASM_DIR` environment variable, but the argument \ - takes precedence, if specified.", - )) + takes precedence, if specified." + ))) .arg( PRE_GENESIS .def() .global(true) - .help("Dispatch pre-genesis specific logic."), + .help(wrap!("Dispatch pre-genesis specific logic.")), ) } } @@ -3303,14 +3328,14 @@ pub mod args { } fn def(app: App) -> App { - app.arg(NAMADA_START_TIME.def().help( + app.arg(NAMADA_START_TIME.def().help(wrap!( "The start time of the ledger. Accepts a relaxed form of \ RFC3339. A space or a 'T' are accepted as the separator \ between the date and time components. Additional spaces are \ allowed between each component.\nAll of these examples are \ equivalent:\n2023-01-20T12:12:12Z\n2023-01-20 \ - 12:12:12Z\n2023- 01-20T12: 12:12Z", - )) + 12:12:12Z\n2023- 01-20T12: 12:12Z" + ))) } } @@ -3339,14 +3364,22 @@ pub mod args { app.arg( NAMADA_START_TIME .def() - .help("The start time of the ledger."), + .help(wrap!("The start time of the ledger.")), + ) + .arg( + BLOCK_HEIGHT + .def() + .help(wrap!("The block height to run until.")), + ) + .arg( + HALT_ACTION + .def() + .help(wrap!("Halt at the given block height")), ) - .arg(BLOCK_HEIGHT.def().help("The block height to run until.")) - .arg(HALT_ACTION.def().help("Halt at the given block height")) .arg( SUSPEND_ACTION .def() - .help("Suspend consensus at the given block height"), + .help(wrap!("Suspend consensus at the given block height")), ) .group( ArgGroup::new("find_flags") @@ -3380,20 +3413,18 @@ pub mod args { } fn def(app: App) -> App { - app.arg(BLOCK_HEIGHT_OPT.def().help( + app.arg(BLOCK_HEIGHT_OPT.def().help(wrap!( "The block height to dump. Defaults to latest committed - block.", - )) - .arg(OUT_FILE_PATH_OPT.def().help( + block." + ))) + .arg(OUT_FILE_PATH_OPT.def().help(wrap!( "Path for the output file (omitting file extension). Defaults \ to \"db_dump.{block_height}.toml\" in the current working \ - directory.", - )) - .arg( - HISTORIC - .def() - .help("If provided, dump also the diff of the last height"), - ) + directory." + ))) + .arg(HISTORIC.def().help(wrap!( + "If provided, dump also the diff of the last height" + ))) } } @@ -3417,17 +3448,17 @@ pub mod args { } fn def(app: App) -> App { - app.arg(PATH.def().help( - "The path to a json of key-value pairs to update the DB with.", - )) - .arg(DRY_RUN_TX.def().help( + app.arg(PATH.def().help(wrap!( + "The path to a json of key-value pairs to update the DB with." + ))) + .arg(DRY_RUN_TX.def().help(wrap!( "If set, applies the updates but does not persist them. Using \ - for testing and debugging.", - )) + for testing and debugging." + ))) .arg( - BLOCK_HEIGHT - .def() - .help("The height at which the hard fork is happening."), + BLOCK_HEIGHT.def().help(wrap!( + "The height at which the hard fork is happening." + )), ) } } @@ -3455,15 +3486,15 @@ pub mod args { } fn def(app: App) -> App { - app.arg(DB_KEY.def().help("A database key to query")) - .arg(HASH.def().help( + app.arg(DB_KEY.def().help(wrap!("A database key to query"))) + .arg(HASH.def().help(wrap!( "The hex encoded type hash of the value contained under \ - the provided key.", - )) - .arg(DB_COLUMN_FAMILY.def().help( + the provided key." + ))) + .arg(DB_COLUMN_FAMILY.def().help(wrap!( "The column family under which the key is kept. Defaults \ - to the subspace column family if none is provided.", - )) + to the subspace column family if none is provided." + ))) } } @@ -3479,10 +3510,10 @@ pub mod args { } fn def(app: App) -> App { - app.arg(DATA_PATH.def().help( + app.arg(DATA_PATH.def().help(wrap!( "The path to the toml file containing the updated local \ - configuration.", - )) + configuration." + ))) } } @@ -3549,9 +3580,9 @@ pub mod args { fn def(app: App) -> App { app.add_args::>().arg( - TX_HASH - .def() - .help("The hash of the transaction being looked up."), + TX_HASH.def().help(wrap!( + "The hash of the transaction being looked up." + )), ) } } @@ -3612,39 +3643,39 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() .arg( - ERC20 - .def() - .help("The Ethereum address of the ERC20 token."), - ) - .arg( - BRIDGE_POOL_TARGET - .def() - .help("The Ethereum address receiving the tokens."), + ERC20.def().help(wrap!( + "The Ethereum address of the ERC20 token." + )), ) .arg( - SOURCE.def().help("The Namada address sending the tokens."), + BRIDGE_POOL_TARGET.def().help(wrap!( + "The Ethereum address receiving the tokens." + )), ) .arg( - AMOUNT.def().help( - "The amount of tokens being sent across the bridge.", - ), + SOURCE + .def() + .help(wrap!("The Namada address sending the tokens.")), ) - .arg(BRIDGE_POOL_GAS_AMOUNT.def().help( + .arg(AMOUNT.def().help(wrap!( + "The amount of tokens being sent across the bridge." + ))) + .arg(BRIDGE_POOL_GAS_AMOUNT.def().help(wrap!( "The amount of gas you wish to pay to have this transfer \ - relayed to Ethereum.", - )) - .arg(BRIDGE_POOL_GAS_PAYER.def().help( + relayed to Ethereum." + ))) + .arg(BRIDGE_POOL_GAS_PAYER.def().help(wrap!( "The Namada address of the account paying the gas. By \ - default, it is the same as the source.", - )) - .arg(BRIDGE_POOL_GAS_TOKEN.def().help( + default, it is the same as the source." + ))) + .arg(BRIDGE_POOL_GAS_TOKEN.def().help(wrap!( "The token for paying the Bridge pool gas fees. Defaults \ - to NAM.", - )) - .arg(NUT.def().help( + to NAM." + ))) + .arg(NUT.def().help(wrap!( "Add Non Usable Tokens (NUTs) to the Bridge pool. These \ - are usually obtained from invalid transfers to Namada.", - )) + are usually obtained from invalid transfers to Namada." + ))) } } @@ -3709,21 +3740,21 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(MAX_ETH_GAS.def().help( + .arg(MAX_ETH_GAS.def().help(wrap!( "The maximum amount Ethereum gas that can be spent during \ - the relay call.", - )) - .arg(ETH_GAS.def().help( + the relay call." + ))) + .arg(ETH_GAS.def().help(wrap!( "Under ideal conditions, relaying transfers will yield a \ net profit. If that is not possible, setting this \ optional value will result in a batch transfer that \ costs as close to the given value as possible without \ - exceeding it.", - )) - .arg(CONVERSION_TABLE.def().help( + exceeding it." + ))) + .arg(CONVERSION_TABLE.def().help(wrap!( "Path to a JSON object containing a mapping between token \ - aliases (or addresses) and their conversion rates in gwei", - )) + aliases (or addresses) and their conversion rates in gwei" + ))) } } @@ -3762,15 +3793,13 @@ pub mod args { fn def(app: App) -> App { app.arg(LEDGER_ADDRESS.def().help(LEDGER_ADDRESS_ABOUT)) - .arg(HASH_LIST.def().help( + .arg(HASH_LIST.def().help(wrap!( "Whitespace separated Keccak hash list of transfers in \ - the Bridge pool.", - )) - .arg( - RELAYER - .def() - .help("The rewards address for relaying this proof."), - ) + the Bridge pool." + ))) + .arg(RELAYER.def().help(wrap!( + "The rewards address for relaying this proof." + ))) } } @@ -3832,41 +3861,39 @@ pub mod args { fn def(app: App) -> App { app.arg(LEDGER_ADDRESS.def().help(LEDGER_ADDRESS_ABOUT)) - .arg(SAFE_MODE.def().help( + .arg(SAFE_MODE.def().help(wrap!( "Safe mode overrides keyboard interrupt signals, to \ - ensure Ethereum transfers aren't canceled midway through.", - )) - .arg(HASH_LIST.def().help( + ensure Ethereum transfers aren't canceled midway through." + ))) + .arg(HASH_LIST.def().help(wrap!( "Whitespace separated Keccak hash list of transfers in \ - the Bridge pool.", - )) - .arg( - RELAYER - .def() - .help("The rewards address for relaying this proof."), - ) - .arg(ETH_ADDRESS_OPT.def().help( + the Bridge pool." + ))) + .arg(RELAYER.def().help(wrap!( + "The rewards address for relaying this proof." + ))) + .arg(ETH_ADDRESS_OPT.def().help(wrap!( "The address of the Ethereum wallet to pay the gas fees. \ - If unset, the default wallet is used.", - )) - .arg(ETH_GAS.def().help( - "The Ethereum gas that can be spent during the relay call.", - )) - .arg( - ETH_GAS_PRICE.def().help( - "The price of Ethereum gas, during the relay call.", - ), - ) - .arg(ETH_RPC_ENDPOINT.def().help("The Ethereum RPC endpoint.")) + If unset, the default wallet is used." + ))) + .arg(ETH_GAS.def().help(wrap!( + "The Ethereum gas that can be spent during the relay call." + ))) + .arg(ETH_GAS_PRICE.def().help(wrap!( + "The price of Ethereum gas, during the relay call." + ))) .arg( - ETH_CONFIRMATIONS + ETH_RPC_ENDPOINT .def() - .help("The number of block confirmations on Ethereum."), + .help(wrap!("The Ethereum RPC endpoint.")), ) - .arg(ETH_SYNC.def().help( + .arg(ETH_CONFIRMATIONS.def().help(wrap!( + "The number of block confirmations on Ethereum." + ))) + .arg(ETH_SYNC.def().help(wrap!( "Synchronize with the network, or exit immediately, if \ - the Ethereum node has fallen behind.", - )) + the Ethereum node has fallen behind." + ))) } } @@ -3893,9 +3920,9 @@ pub mod args { fn def(app: App) -> App { app.arg(LEDGER_ADDRESS.def().help(LEDGER_ADDRESS_ABOUT)) - .arg(EPOCH.def().help( - "The epoch of the Bridge set of validators to query.", - )) + .arg(EPOCH.def().help(wrap!( + "The epoch of the Bridge set of validators to query." + ))) } } @@ -3922,9 +3949,9 @@ pub mod args { fn def(app: App) -> App { app.arg(LEDGER_ADDRESS.def().help(LEDGER_ADDRESS_ABOUT)) - .arg(EPOCH.def().help( - "The epoch of the Governance set of validators to query.", - )) + .arg(EPOCH.def().help(wrap!( + "The epoch of the Governance set of validators to query." + ))) } } @@ -3951,11 +3978,9 @@ pub mod args { fn def(app: App) -> App { app.arg(LEDGER_ADDRESS.def().help(LEDGER_ADDRESS_ABOUT)) - .arg( - EPOCH.def().help( - "The epoch of the set of validators to be proven.", - ), - ) + .arg(EPOCH.def().help(wrap!( + "The epoch of the set of validators to be proven." + ))) } } @@ -4014,49 +4039,47 @@ pub mod args { fn def(app: App) -> App { app.arg(LEDGER_ADDRESS.def().help(LEDGER_ADDRESS_ABOUT)) - .arg(SAFE_MODE.def().help( + .arg(SAFE_MODE.def().help(wrap!( "Safe mode overrides keyboard interrupt signals, to \ - ensure Ethereum transfers aren't canceled midway through.", - )) - .arg(DAEMON_MODE.def().help( + ensure Ethereum transfers aren't canceled midway through." + ))) + .arg(DAEMON_MODE.def().help(wrap!( "Run in daemon mode, which will continuously perform \ - validator set updates.", - )) - .arg(DAEMON_MODE_RETRY_DUR.def().help( + validator set updates." + ))) + .arg(DAEMON_MODE_RETRY_DUR.def().help(wrap!( "The amount of time to sleep between failed daemon mode \ - relays.", - )) - .arg(DAEMON_MODE_SUCCESS_DUR.def().help( + relays." + ))) + .arg(DAEMON_MODE_SUCCESS_DUR.def().help(wrap!( "The amount of time to sleep between successful daemon \ - mode relays.", - )) - .arg(ETH_ADDRESS_OPT.def().help( + mode relays." + ))) + .arg(ETH_ADDRESS_OPT.def().help(wrap!( "The address of the Ethereum wallet to pay the gas fees. \ - If unset, the default wallet is used.", - )) - .arg( - EPOCH - .def() - .help("The epoch of the set of validators to relay."), - ) - .arg(ETH_GAS.def().help( - "The Ethereum gas that can be spent during the relay call.", - )) - .arg( - ETH_GAS_PRICE.def().help( - "The price of Ethereum gas, during the relay call.", - ), - ) - .arg(ETH_RPC_ENDPOINT.def().help("The Ethereum RPC endpoint.")) + If unset, the default wallet is used." + ))) + .arg(EPOCH.def().help(wrap!( + "The epoch of the set of validators to relay." + ))) + .arg(ETH_GAS.def().help(wrap!( + "The Ethereum gas that can be spent during the relay call." + ))) + .arg(ETH_GAS_PRICE.def().help(wrap!( + "The price of Ethereum gas, during the relay call." + ))) .arg( - ETH_CONFIRMATIONS + ETH_RPC_ENDPOINT .def() - .help("The number of block confirmations on Ethereum."), + .help(wrap!("The Ethereum RPC endpoint.")), ) - .arg(ETH_SYNC.def().help( + .arg(ETH_CONFIRMATIONS.def().help(wrap!( + "The number of block confirmations on Ethereum." + ))) + .arg(ETH_SYNC.def().help(wrap!( "Synchronize with the network, or exit immediately, if \ - the Ethereum node has fallen behind.", - )) + the Ethereum node has fallen behind." + ))) } } @@ -4103,33 +4126,33 @@ pub mod args { .arg( CODE_PATH_OPT .def() - .help("The path to the transaction's WASM code.") + .help(wrap!("The path to the transaction's WASM code.")) .conflicts_with(TX_PATH_OPT.name), ) .arg( DATA_PATH_OPT .def() - .help( + .help(wrap!( "The data file at this path containing arbitrary \ bytes will be passed to the transaction code \ - when it's executed.", - ) + when it's executed." + )) .requires(CODE_PATH_OPT.name) .conflicts_with(TX_PATH_OPT.name), ) .arg( TX_PATH_OPT .def() - .help("The path to a serialized transaction.") + .help(wrap!("The path to a serialized transaction.")) .conflicts_with_all([ CODE_PATH_OPT.name, DATA_PATH_OPT.name, ]), ) - .arg(OWNER.def().help( + .arg(OWNER.def().help(wrap!( "The address corresponding to the signatures or signing \ - keys.", - )) + keys." + ))) } } @@ -4174,16 +4197,20 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(TRANSFER_SOURCE.def().help( + .arg(TRANSFER_SOURCE.def().help(wrap!( "The source account address. The source's key may be used \ - to produce the signature.", - )) - .arg(TRANSFER_TARGET.def().help( + to produce the signature." + ))) + .arg(TRANSFER_TARGET.def().help(wrap!( "The target account address. The target's key may be used \ - to produce the signature.", - )) - .arg(TOKEN.def().help("The transfer token.")) - .arg(AMOUNT.def().help("The amount to transfer in decimal.")) + to produce the signature." + ))) + .arg(TOKEN.def().help(wrap!("The transfer token."))) + .arg( + AMOUNT + .def() + .help(wrap!("The amount to transfer in decimal.")), + ) } } @@ -4249,32 +4276,36 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(SOURCE.def().help( + .arg(SOURCE.def().help(wrap!( "The source account address. The source's key is used to \ - produce the signature.", - )) - .arg(RECEIVER.def().help( - "The receiver address on the destination chain as string.", - )) - .arg(TOKEN.def().help("The transfer token.")) - .arg(AMOUNT.def().help("The amount to transfer in decimal.")) - .arg(PORT_ID.def().help("The port ID.")) - .arg(CHANNEL_ID.def().help("The channel ID.")) + produce the signature." + ))) + .arg(RECEIVER.def().help(wrap!( + "The receiver address on the destination chain as string." + ))) + .arg(TOKEN.def().help(wrap!("The transfer token."))) .arg( - TIMEOUT_HEIGHT + AMOUNT .def() - .help("The timeout height of the destination chain."), + .help(wrap!("The amount to transfer in decimal.")), ) - .arg(TIMEOUT_SEC_OFFSET.def().help("The timeout as seconds.")) - .arg(REFUND_TARGET.def().help( - "The refund target address when IBC shielded transfer \ - failure.", - )) + .arg(PORT_ID.def().help(wrap!("The port ID."))) + .arg(CHANNEL_ID.def().help(wrap!("The channel ID."))) + .arg(TIMEOUT_HEIGHT.def().help(wrap!( + "The timeout height of the destination chain." + ))) .arg( - IBC_TRANSFER_MEMO_PATH + TIMEOUT_SEC_OFFSET .def() - .help("The path for the memo field of ICS20 transfer."), + .help(wrap!("The timeout as seconds.")), ) + .arg(REFUND_TARGET.def().help(wrap!( + "The refund target address when IBC shielded transfer \ + failure." + ))) + .arg(IBC_TRANSFER_MEMO_PATH.def().help(wrap!( + "The path for the memo field of ICS20 transfer." + ))) } } @@ -4322,20 +4353,20 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(CODE_PATH_OPT.def().help( + .arg(CODE_PATH_OPT.def().help(wrap!( "The path to the validity predicate WASM code to be used \ for the new account. Uses the default user VP if none \ - specified.", - )) - .arg(PUBLIC_KEYS.def().help( + specified." + ))) + .arg(PUBLIC_KEYS.def().help(wrap!( "A list public keys to be associated with the new account \ - in hexadecimal encoding.", - )) - .arg(THRESHOLD.def().help( + in hexadecimal encoding." + ))) + .arg(THRESHOLD.def().help(wrap!( "The minimum number of signature to be provided for \ authorization. Must be less then the maximum number of \ - public keys provided.", - )) + public keys provided." + ))) } } @@ -4414,61 +4445,69 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(ADDRESS.def().help( - "Address of an account that will become a validator.", - )) - .arg(SCHEME.def().help( + .arg(ADDRESS.def().help(wrap!( + "Address of an account that will become a validator." + ))) + .arg(SCHEME.def().help(wrap!( "The key scheme/type used for the validator keys. \ - Currently supports ed25519 and secp256k1.", - )) - .arg(VALIDATOR_CONSENSUS_KEY.def().help( + Currently supports ed25519 and secp256k1." + ))) + .arg(VALIDATOR_CONSENSUS_KEY.def().help(wrap!( "A consensus key for the validator account. A new one \ will be generated if none given. Note that this must be \ - ed25519.", - )) - .arg(VALIDATOR_ETH_COLD_KEY.def().help( + ed25519." + ))) + .arg(VALIDATOR_ETH_COLD_KEY.def().help(wrap!( "An Eth cold key for the validator account. A new one \ will be generated if none given. Note that this must be \ - secp256k1.", - )) - .arg(VALIDATOR_ETH_HOT_KEY.def().help( + secp256k1." + ))) + .arg(VALIDATOR_ETH_HOT_KEY.def().help(wrap!( "An Eth hot key for the validator account. A new one will \ be generated if none given. Note that this must be \ - secp256k1.", - )) - .arg(PROTOCOL_KEY.def().help( + secp256k1." + ))) + .arg(PROTOCOL_KEY.def().help(wrap!( "A public key for signing protocol transactions. A new \ - one will be generated if none given.", - )) - .arg(COMMISSION_RATE.def().help( + one will be generated if none given." + ))) + .arg(COMMISSION_RATE.def().help(wrap!( "The commission rate charged by the validator for \ delegation rewards. Expressed as a decimal between 0 and \ - 1. This is a required parameter.", - )) - .arg(MAX_COMMISSION_RATE_CHANGE.def().help( + 1. This is a required parameter." + ))) + .arg(MAX_COMMISSION_RATE_CHANGE.def().help(wrap!( "The maximum change per epoch in the commission rate \ charged by the validator for delegation rewards. \ Expressed as a decimal between 0 and 1. This is a \ - required parameter.", - )) - .arg(EMAIL.def().help("The validator's email.")) - .arg(DESCRIPTION_OPT.def().help("The validator's description.")) - .arg(WEBSITE_OPT.def().help("The validator's website.")) - .arg(DISCORD_OPT.def().help("The validator's discord handle.")) - .arg(AVATAR_OPT.def().help("The validator's avatar.")) - .arg(VALIDATOR_NAME_OPT.def().help( + required parameter." + ))) + .arg(EMAIL.def().help(wrap!("The validator's email."))) + .arg( + DESCRIPTION_OPT + .def() + .help(wrap!("The validator's description.")), + ) + .arg(WEBSITE_OPT.def().help(wrap!("The validator's website."))) + .arg( + DISCORD_OPT + .def() + .help(wrap!("The validator's discord handle.")), + ) + .arg(AVATAR_OPT.def().help(wrap!("The validator's avatar."))) + .arg(VALIDATOR_NAME_OPT.def().help(wrap!( "The validator's name, used to identify the validator in \ - online services.", - )) - .arg(VALIDATOR_CODE_PATH.def().help( + online services." + ))) + .arg(VALIDATOR_CODE_PATH.def().help(wrap!( "The path to the validity predicate WASM code to be used \ for the validator account. Uses the default validator VP \ - if none specified.", - )) - .arg(UNSAFE_DONT_ENCRYPT.def().help( + if none specified." + ))) + .arg(UNSAFE_DONT_ENCRYPT.def().help(wrap!( "UNSAFE: Do not encrypt the generated keypairs. Do not \ - use this for keys used in a live network.", - )) + use this for keys used in a live network." + ))) } } @@ -4569,68 +4608,76 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(SCHEME.def().help( + .arg(SCHEME.def().help(wrap!( "The key scheme/type used for the validator keys. \ - Currently supports ed25519 and secp256k1.", - )) - .arg(VALIDATOR_ACCOUNT_KEYS.def().help( + Currently supports ed25519 and secp256k1." + ))) + .arg(VALIDATOR_ACCOUNT_KEYS.def().help(wrap!( "A list public keys to be associated with the new account \ in hexadecimal encoding. A new one will be generated if \ - none given.", - )) - .arg(VALIDATOR_CONSENSUS_KEY.def().help( + none given." + ))) + .arg(VALIDATOR_CONSENSUS_KEY.def().help(wrap!( "A consensus key for the validator account. A new one \ will be generated if none given. Note that this must be \ - ed25519.", - )) - .arg(VALIDATOR_ETH_COLD_KEY.def().help( + ed25519." + ))) + .arg(VALIDATOR_ETH_COLD_KEY.def().help(wrap!( "An Eth cold key for the validator account. A new one \ will be generated if none given. Note that this must be \ - secp256k1.", - )) - .arg(VALIDATOR_ETH_HOT_KEY.def().help( + secp256k1." + ))) + .arg(VALIDATOR_ETH_HOT_KEY.def().help(wrap!( "An Eth hot key for the validator account. A new one will \ be generated if none given. Note that this must be \ - secp256k1.", - )) - .arg(PROTOCOL_KEY.def().help( + secp256k1." + ))) + .arg(PROTOCOL_KEY.def().help(wrap!( "A public key for signing protocol transactions. A new \ - one will be generated if none given.", - )) - .arg(COMMISSION_RATE.def().help( + one will be generated if none given." + ))) + .arg(COMMISSION_RATE.def().help(wrap!( "The commission rate charged by the validator for \ delegation rewards. Expressed as a decimal between 0 and \ - 1. This is a required parameter.", - )) - .arg(MAX_COMMISSION_RATE_CHANGE.def().help( + 1. This is a required parameter." + ))) + .arg(MAX_COMMISSION_RATE_CHANGE.def().help(wrap!( "The maximum change per epoch in the commission rate \ charged by the validator for delegation rewards. \ Expressed as a decimal between 0 and 1. This is a \ - required parameter.", - )) - .arg(EMAIL.def().help("The validator's email.")) - .arg(DESCRIPTION_OPT.def().help("The validator's description.")) - .arg(WEBSITE_OPT.def().help("The validator's website.")) - .arg(DISCORD_OPT.def().help("The validator's discord handle.")) - .arg(AVATAR_OPT.def().help("The validator's avatar.")) - .arg(VALIDATOR_NAME_OPT.def().help( + required parameter." + ))) + .arg(EMAIL.def().help(wrap!("The validator's email."))) + .arg( + DESCRIPTION_OPT + .def() + .help(wrap!("The validator's description.")), + ) + .arg(WEBSITE_OPT.def().help(wrap!("The validator's website."))) + .arg( + DISCORD_OPT + .def() + .help(wrap!("The validator's discord handle.")), + ) + .arg(AVATAR_OPT.def().help(wrap!("The validator's avatar."))) + .arg(VALIDATOR_NAME_OPT.def().help(wrap!( "The validator's alias, used to identify the validator in \ - online services.", - )) - .arg(VALIDATOR_CODE_PATH.def().help( + online services." + ))) + .arg(VALIDATOR_CODE_PATH.def().help(wrap!( "The path to the validity predicate WASM code to be used \ for the validator account. Uses the default validator VP \ - if none specified.", - )) - .arg(UNSAFE_DONT_ENCRYPT.def().help( + if none specified." + ))) + .arg(UNSAFE_DONT_ENCRYPT.def().help(wrap!( "UNSAFE: Do not encrypt the generated keypairs. Do not \ - use this for keys used in a live network.", - )) - .arg(THRESHOLD.def().help( + use this for keys used in a live network." + ))) + .arg(THRESHOLD.def().help(wrap!( "The minimum number of signature to be provided for \ authorization. Must be less then the maximum number of \ - public keys provided.", - )) + public keys provided." + ))) } } @@ -4679,24 +4726,22 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg( - CODE_PATH_OPT.def().help( - "The path to the new validity predicate WASM code.", - ), - ) - .arg(ADDRESS.def().help( + .arg(CODE_PATH_OPT.def().help(wrap!( + "The path to the new validity predicate WASM code." + ))) + .arg(ADDRESS.def().help(wrap!( "The account's address. It's key is used to produce the \ - signature.", - )) - .arg(PUBLIC_KEYS.def().help( + signature." + ))) + .arg(PUBLIC_KEYS.def().help(wrap!( "A list public keys to be associated with the new account \ - in hexadecimal encoding.", - )) - .arg(THRESHOLD.def().help( + in hexadecimal encoding." + ))) + .arg(THRESHOLD.def().help(wrap!( "The minimum number of signature to be provided for \ authorization. Must be less then the maximum number of \ - public keys provided.", - )) + public keys provided." + ))) } } @@ -4746,12 +4791,16 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(VALIDATOR.def().help("Validator address.")) - .arg(AMOUNT.def().help("Amount of tokens to stake in a bond.")) - .arg(SOURCE_OPT.def().help( + .arg(VALIDATOR.def().help(wrap!("Validator address."))) + .arg( + AMOUNT + .def() + .help(wrap!("Amount of tokens to stake in a bond.")), + ) + .arg(SOURCE_OPT.def().help(wrap!( "Source address for delegations. For self-bonds, the \ - validator is also the source.", - )) + validator is also the source." + ))) } } @@ -4801,17 +4850,17 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(VALIDATOR.def().help("Validator address.")) + .arg(VALIDATOR.def().help(wrap!("Validator address."))) .arg( AMOUNT .def() - .help("Amount of tokens to unbond from a bond."), + .help(wrap!("Amount of tokens to unbond from a bond.")), ) - .arg(SOURCE_OPT.def().help( + .arg(SOURCE_OPT.def().help(wrap!( "Source address for unbonding from delegations. For \ unbonding from self-bonds, the validator is also the \ - source.", - )) + source." + ))) } } @@ -4852,12 +4901,12 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(STEWARD.def().help("Steward address.")) - .arg(DATA_PATH.def().help( + .arg(STEWARD.def().help(wrap!("Steward address."))) + .arg(DATA_PATH.def().help(wrap!( "The path to the file that describes the commission \ split. The file must contain a map from namada address \ - to a percentage. Percentages must sum to 1 or less.", - )) + to a percentage. Percentages must sum to 1 or less." + ))) } } @@ -4892,7 +4941,7 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(STEWARD.def().help("Steward address.")) + .arg(STEWARD.def().help(wrap!("Steward address."))) } } @@ -4945,19 +4994,19 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() + .arg(SOURCE_VALIDATOR.def().help(wrap!( + "Source validator address for the redelegation." + ))) + .arg(DESTINATION_VALIDATOR.def().help(wrap!( + "Destination validator address for the redelegation." + ))) + .arg(OWNER.def().help(wrap!( + "Delegator (owner) address of the bonds that are being \ + redelegated." + ))) .arg( - SOURCE_VALIDATOR - .def() - .help("Source validator address for the redelegation."), + AMOUNT.def().help(wrap!("Amount of tokens to redelegate.")), ) - .arg(DESTINATION_VALIDATOR.def().help( - "Destination validator address for the redelegation.", - )) - .arg(OWNER.def().help( - "Delegator (owner) address of the bonds that are being \ - redelegated.", - )) - .arg(AMOUNT.def().help("Amount of tokens to redelegate.")) } } @@ -5000,13 +5049,13 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(DATA_PATH.def().help( - "The data path file (json) that describes the proposal.", - )) + .arg(DATA_PATH.def().help(wrap!( + "The data path file (json) that describes the proposal." + ))) .arg( PROPOSAL_ETH .def() - .help("Flag if the proposal is of type eth.") + .help(wrap!("Flag if the proposal is of type eth.")) .conflicts_with_all([ PROPOSAL_PGF_FUNDING.name, PROPOSAL_PGF_STEWARD.name, @@ -5015,10 +5064,10 @@ pub mod args { .arg( PROPOSAL_PGF_STEWARD .def() - .help( + .help(wrap!( "Flag if the proposal is of type pgf-stewards. \ - Used to elect/remove stewards.", - ) + Used to elect/remove stewards." + )) .conflicts_with_all([ PROPOSAL_ETH.name, PROPOSAL_PGF_FUNDING.name, @@ -5027,10 +5076,10 @@ pub mod args { .arg( PROPOSAL_PGF_FUNDING .def() - .help( + .help(wrap!( "Flag if the proposal is of type pgf-funding. \ - Used to control continuous/retro pgf fundings.", - ) + Used to control continuous/retro pgf fundings." + )) .conflicts_with_all([ PROPOSAL_ETH.name, PROPOSAL_PGF_STEWARD.name, @@ -5079,11 +5128,15 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(PROPOSAL_ID_OPT.def().help("The proposal identifier.")) - .arg(PROPOSAL_VOTE.def().help( - "The vote for the proposal. Either yay, nay, or abstain.", - )) - .arg(ADDRESS.def().help("The address of the voter.")) + .arg( + PROPOSAL_ID_OPT + .def() + .help(wrap!("The proposal identifier.")), + ) + .arg(PROPOSAL_VOTE.def().help(wrap!( + "The vote for the proposal. Either yay, nay, or abstain." + ))) + .arg(ADDRESS.def().help(wrap!("The address of the voter."))) } } @@ -5114,7 +5167,7 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(PUBLIC_KEY.def().help("A public key to reveal.")) + .arg(PUBLIC_KEY.def().help(wrap!("A public key to reveal."))) } } @@ -5141,8 +5194,11 @@ pub mod args { } fn def(app: App) -> App { - app.add_args::>() - .arg(PROPOSAL_ID_OPT.def().help("The proposal identifier.")) + app.add_args::>().arg( + PROPOSAL_ID_OPT + .def() + .help(wrap!("The proposal identifier.")), + ) } } @@ -5176,8 +5232,16 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(PROPOSAL_ID_OPT.def().help("The proposal identifier.")) - .arg(VOTER_OPT.def().help("The address of the proposal voter.")) + .arg( + PROPOSAL_ID_OPT + .def() + .help(wrap!("The proposal identifier.")), + ) + .arg( + VOTER_OPT + .def() + .help(wrap!("The address of the proposal voter.")), + ) } } @@ -5213,7 +5277,7 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(PROPOSAL_ID.def().help("The proposal identifier.")) + .arg(PROPOSAL_ID.def().help(wrap!("The proposal identifier."))) } } @@ -5304,12 +5368,12 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(VALIDATOR.def().help("Validator address.")) - .arg(SOURCE_OPT.def().help( + .arg(VALIDATOR.def().help(wrap!("Validator address."))) + .arg(SOURCE_OPT.def().help(wrap!( "Source address for withdrawing from delegations. For \ withdrawing from self-bonds, this arg does not need to \ - be supplied.", - )) + be supplied." + ))) } } @@ -5348,11 +5412,11 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(VALIDATOR.def().help("Validator address.")) - .arg(SOURCE_OPT.def().help( + .arg(VALIDATOR.def().help(wrap!("Validator address."))) + .arg(SOURCE_OPT.def().help(wrap!( "Source address for claiming rewards for a bond. For \ - self-bonds, the validator is also the source.", - )) + self-bonds, the validator is also the source." + ))) } } @@ -5386,15 +5450,13 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() .arg( - EPOCH - .def() - .help("The epoch for which to query conversions."), - ) - .arg( - TOKEN_OPT.def().help( - "The token address for which to query conversions.", - ), + EPOCH.def().help(wrap!( + "The epoch for which to query conversions." + )), ) + .arg(TOKEN_OPT.def().help(wrap!( + "The token address for which to query conversions." + ))) } } @@ -5423,7 +5485,7 @@ pub mod args { app.add_args::>().arg( OWNER .def() - .help("The substorage space address to query.") + .help(wrap!("The substorage space address to query.")) .required(true), ) } @@ -5465,20 +5527,18 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() .arg( - BALANCE_OWNER - .def() - .help("The account address whose balance to query."), - ) - .arg( - TOKEN - .def() - .help("The token's address whose balance to query."), + BALANCE_OWNER.def().help(wrap!( + "The account address whose balance to query." + )), ) .arg( - NO_CONVERSIONS.def().help( - "Whether not to automatically perform conversions.", - ), + TOKEN.def().help(wrap!( + "The token's address whose balance to query." + )), ) + .arg(NO_CONVERSIONS.def().help(wrap!( + "Whether not to automatically perform conversions." + ))) } } @@ -5514,16 +5574,12 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg( - OWNER_OPT.def().help( - "The owner account address whose bonds to query.", - ), - ) - .arg( - VALIDATOR_OPT - .def() - .help("The validator's address whose bonds to query."), - ) + .arg(OWNER_OPT.def().help(wrap!( + "The owner account address whose bonds to query." + ))) + .arg(VALIDATOR_OPT.def().help(wrap!( + "The validator's address whose bonds to query." + ))) } } @@ -5558,13 +5614,13 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(VALIDATOR_OPT.def().help( - "The validator's address whose bonded stake to query.", - )) - .arg(EPOCH.def().help( + .arg(VALIDATOR_OPT.def().help(wrap!( + "The validator's address whose bonded stake to query." + ))) + .arg(EPOCH.def().help(wrap!( "The epoch at which to query (corresponding to the last \ - committed block, if not specified).", - )) + committed block, if not specified)." + ))) } } @@ -5597,15 +5653,13 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg( - VALIDATOR.def().help( - "The validator's address whose state is queried.", - ), - ) - .arg(EPOCH.def().help( + .arg(VALIDATOR.def().help(wrap!( + "The validator's address whose state is queried." + ))) + .arg(EPOCH.def().help(wrap!( "The epoch at which to query (corresponding to the last \ - committed block, if not specified).", - )) + committed block, if not specified)." + ))) } } @@ -5645,13 +5699,13 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(VALIDATOR.def().help( - "The validator's address whose commission rate to change.", - )) + .arg(VALIDATOR.def().help(wrap!( + "The validator's address whose commission rate to change." + ))) .arg( COMMISSION_RATE .def() - .help("The desired new commission rate."), + .help(wrap!("The desired new commission rate.")), ) } } @@ -5694,17 +5748,17 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(VALIDATOR.def().help( - "The validator's address whose consensus key to change.", - )) - .arg(VALIDATOR_CONSENSUS_KEY.def().help( + .arg(VALIDATOR.def().help(wrap!( + "The validator's address whose consensus key to change." + ))) + .arg(VALIDATOR_CONSENSUS_KEY.def().help(wrap!( "The desired new consensus key. A new one will be \ - generated if none given. Note this key must be ed25519.", - )) - .arg(UNSAFE_DONT_ENCRYPT.def().help( + generated if none given. Note this key must be ed25519." + ))) + .arg(UNSAFE_DONT_ENCRYPT.def().help(wrap!( "UNSAFE: Do not encrypt the generated keypairs. Do not \ - use this for keys used in a live network.", - )) + use this for keys used in a live network." + ))) } } @@ -5760,40 +5814,40 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(VALIDATOR.def().help( - "The validator's address whose commission rate to change.", - )) - .arg(EMAIL_OPT.def().help( + .arg(VALIDATOR.def().help(wrap!( + "The validator's address whose commission rate to change." + ))) + .arg(EMAIL_OPT.def().help(wrap!( "The desired new validator email. To remove the existing \ - email, pass an empty string to this argument.", - )) - .arg(DESCRIPTION_OPT.def().help( + email, pass an empty string to this argument." + ))) + .arg(DESCRIPTION_OPT.def().help(wrap!( "The desired new validator description. To remove the \ existing description, pass an empty string to this \ - argument.", - )) - .arg(WEBSITE_OPT.def().help( + argument." + ))) + .arg(WEBSITE_OPT.def().help(wrap!( "The desired new validator website. To remove the \ - existing website, pass an empty string to this argument.", - )) - .arg(DISCORD_OPT.def().help( + existing website, pass an empty string to this argument." + ))) + .arg(DISCORD_OPT.def().help(wrap!( "The desired new validator discord handle. To remove the \ existing discord handle, pass an empty string to this \ - argument.", - )) - .arg(AVATAR_OPT.def().help( + argument." + ))) + .arg(AVATAR_OPT.def().help(wrap!( "The desired new validator avatar url. To remove the \ - existing avatar, pass an empty string to this argument.", - )) - .arg(VALIDATOR_NAME_OPT.def().help( + existing avatar, pass an empty string to this argument." + ))) + .arg(VALIDATOR_NAME_OPT.def().help(wrap!( "The desired new validator name, used to identify the \ validator in online services. To remove the existing \ - validator alias, pass an empty string to this argument.", - )) + validator alias, pass an empty string to this argument." + ))) .arg( COMMISSION_RATE_OPT .def() - .help("The desired new commission rate."), + .help(wrap!("The desired new commission rate.")), ) } } @@ -5829,9 +5883,9 @@ pub mod args { fn def(app: App) -> App { app.add_args::>().arg( - VALIDATOR - .def() - .help("The address of the jailed validator to unjail."), + VALIDATOR.def().help(wrap!( + "The address of the jailed validator to unjail." + )), ) } } @@ -5871,7 +5925,7 @@ pub mod args { app.add_args::>().arg( VALIDATOR .def() - .help("The address of the validator to deactivate."), + .help(wrap!("The address of the validator to deactivate.")), ) } } @@ -5911,7 +5965,7 @@ pub mod args { app.add_args::>().arg( VALIDATOR .def() - .help("The address of the validator to reactivate."), + .help(wrap!("The address of the validator to reactivate.")), ) } } @@ -5948,12 +6002,12 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() + .arg(TX_PATH.def().help(wrap!( + "The path to the tx file with the serialized tx." + ))) .arg( - TX_PATH.def().help( - "The path to the tx file with the serialized tx.", - ), + OWNER.def().help(wrap!("The address of the account owner")), ) - .arg(OWNER.def().help("The address of the account owner")) } } @@ -5977,26 +6031,26 @@ pub mod args { fn def(app: App) -> App { app.arg(LEDGER_ADDRESS.def().help(LEDGER_ADDRESS_ABOUT)) - .arg(BATCH_SIZE_OPT.def().help( + .arg(BATCH_SIZE_OPT.def().help(wrap!( "Optional batch size which determines how many txs to \ - fetch before caching locally. Default is 1.", - )) - .arg(BLOCK_HEIGHT_TO_OPT.def().help( - "Option block height to sync up to. Default is latest.", - )) + fetch before caching locally. Default is 1." + ))) + .arg(BLOCK_HEIGHT_TO_OPT.def().help(wrap!( + "Option block height to sync up to. Default is latest." + ))) .arg( BLOCK_HEIGHT_FROM_OPT .def() - .help("Option block height to sync from."), + .help(wrap!("Option block height to sync from.")), ) - .arg(SPENDING_KEYS.def().help( + .arg(SPENDING_KEYS.def().help(wrap!( "List of new spending keys with which to check note \ - ownership. These will be added to the shielded context.", - )) - .arg(VIEWING_KEYS.def().help( + ownership. These will be added to the shielded context." + ))) + .arg(VIEWING_KEYS.def().help(wrap!( "List of new viewing keys with which to check note \ - ownership. These will be added to the shielded context.", - )) + ownership. These will be added to the shielded context." + ))) } } @@ -6077,27 +6131,25 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(OUTPUT_FOLDER_PATH.def().help( - "The output folder path where the artifact will be stored.", - )) - .arg(TRANSFER_TARGET.def().help("The target address.")) - .arg(TOKEN.def().help("The transfer token.")) - .arg(AMOUNT.def().help("The amount to transfer in decimal.")) - .arg( - PORT_ID - .def() - .help("The port ID via which the token is received."), - ) - .arg( - CHANNEL_ID.def().help( - "The channel ID via which the token is received.", - ), - ) + .arg(OUTPUT_FOLDER_PATH.def().help(wrap!( + "The output folder path where the artifact will be stored." + ))) + .arg(TRANSFER_TARGET.def().help(wrap!("The target address."))) + .arg(TOKEN.def().help(wrap!("The transfer token."))) .arg( - REFUND + AMOUNT .def() - .help("Generate the shielded transfer for refunding."), + .help(wrap!("The amount to transfer in decimal.")), ) + .arg(PORT_ID.def().help(wrap!( + "The port ID via which the token is received." + ))) + .arg(CHANNEL_ID.def().help(wrap!( + "The channel ID via which the token is received." + ))) + .arg(REFUND.def().help(wrap!( + "Generate the shielded transfer for refunding." + ))) } } @@ -6130,13 +6182,13 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(VALIDATOR.def().help( - "The validator's address whose commission rate to query.", - )) - .arg(EPOCH.def().help( + .arg(VALIDATOR.def().help(wrap!( + "The validator's address whose commission rate to query." + ))) + .arg(EPOCH.def().help(wrap!( "The epoch at which to query (corresponding to the last \ - committed block, if not specified).", - )) + committed block, if not specified)." + ))) } } @@ -6162,11 +6214,10 @@ pub mod args { } fn def(app: App) -> App { - app.add_args::>().arg( - VALIDATOR - .def() - .help("The validator's address whose metadata to query."), - ) + app.add_args::>() + .arg(VALIDATOR.def().help(wrap!( + "The validator's address whose metadata to query." + ))) } } @@ -6195,9 +6246,9 @@ pub mod args { fn def(app: App) -> App { app.add_args::>().arg( - VALIDATOR_OPT - .def() - .help("The validator's address whose slashes to query."), + VALIDATOR_OPT.def().help(wrap!( + "The validator's address whose slashes to query." + )), ) } } @@ -6231,14 +6282,14 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(SOURCE_OPT.def().help( + .arg(SOURCE_OPT.def().help(wrap!( "Source address for the rewards query. For self-bonds, \ - this arg does not need to be supplied.", - )) + this arg does not need to be supplied." + ))) .arg( - VALIDATOR - .def() - .help("Validator address for the rewards query."), + VALIDATOR.def().help(wrap!( + "Validator address for the rewards query." + )), ) } } @@ -6251,11 +6302,10 @@ pub mod args { } fn def(app: App) -> App { - app.add_args::>().arg( - OWNER.def().help( - "The address of the owner of the delegations to find.", - ), - ) + app.add_args::>() + .arg(OWNER.def().help(wrap!( + "The address of the owner of the delegations to find." + ))) } } @@ -6288,14 +6338,14 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() .arg( - TM_ADDRESS - .def() - .help("The address of the validator in Tendermint."), + TM_ADDRESS.def().help(wrap!( + "The address of the validator in Tendermint." + )), ) .arg( VALIDATOR_OPT .def() - .help("The native address of the validator."), + .help(wrap!("The native address of the validator.")), ) } } @@ -6340,7 +6390,7 @@ pub mod args { fn def(app: App) -> App { app.add_args::>() - .arg(STORAGE_KEY.def().help("Storage key")) + .arg(STORAGE_KEY.def().help(wrap!("Storage key"))) } } @@ -6426,26 +6476,30 @@ pub mod args { app.arg( DRY_RUN_TX .def() - .help("Simulate the transaction application.") + .help(wrap!("Simulate the transaction application.")) .conflicts_with(DRY_RUN_WRAPPER_TX.name), ) .arg( DRY_RUN_WRAPPER_TX .def() - .help( + .help(wrap!( "Simulate the complete transaction application. This \ - estimates the gas cost of the transaction.", - ) + estimates the gas cost of the transaction." + )) .conflicts_with(DRY_RUN_TX.name), ) - .arg(DUMP_TX.def().help("Dump transaction bytes to a file.")) - .arg(FORCE.def().help( - "Submit the transaction even if it doesn't pass client checks.", - )) - .arg(BROADCAST_ONLY.def().help( + .arg( + DUMP_TX + .def() + .help(wrap!("Dump transaction bytes to a file.")), + ) + .arg(FORCE.def().help(wrap!( + "Submit the transaction even if it doesn't pass client checks." + ))) + .arg(BROADCAST_ONLY.def().help(wrap!( "Do not wait for the transaction to be applied. This will \ - return once the transaction is added to the mempool.", - )) + return once the transaction is added to the mempool." + ))) .arg( CONFIG_RPC_LEDGER_ADDRESS .def() @@ -6453,103 +6507,103 @@ pub mod args { // This used to be "ledger-address", alias for compatibility .alias("ledger-address"), ) - .arg(ALIAS_OPT.def().help( + .arg(ALIAS_OPT.def().help(wrap!( "If any new account is initialized by the tx, use the given \ alias to save it in the wallet. If multiple accounts are \ initialized, the alias will be the prefix of each new \ - address joined with a number.", - )) - .arg(FEE_AMOUNT_OPT.def().help( + address joined with a number." + ))) + .arg(FEE_AMOUNT_OPT.def().help(wrap!( "The amount being paid, per gas unit, for the inclusion of \ - this transaction", - )) - .arg(FEE_TOKEN.def().help("The token for paying the gas")) - .arg(FEE_UNSHIELD_SPENDING_KEY.def().help( + this transaction" + ))) + .arg(FEE_TOKEN.def().help(wrap!("The token for paying the gas"))) + .arg(FEE_UNSHIELD_SPENDING_KEY.def().help(wrap!( "The spending key to be used for fee unshielding. If none is \ - provided, fee will be paid from the unshielded balance only.", - )) - .arg(GAS_LIMIT.def().help( + provided, fee will be paid from the unshielded balance only." + ))) + .arg(GAS_LIMIT.def().help(wrap!( "The multiplier of the gas limit resolution defining the \ - maximum amount of gas needed to run transaction.", - )) - .arg(WALLET_ALIAS_FORCE.def().help( - "Override the alias without confirmation if it already exists.", - )) + maximum amount of gas needed to run transaction." + ))) + .arg(WALLET_ALIAS_FORCE.def().help(wrap!( + "Override the alias without confirmation if it already exists." + ))) .arg( EXPIRATION_OPT .def() - .help( + .help(wrap!( "The expiration datetime of the transaction, after \ which the tx won't be accepted anymore. If not \ provided, a default will be set. All of these \ examples are \ equivalent:\n2012-12-12T12:12:12Z\n2012-12-12 \ - 12:12:12Z\n2012- 12-12T12: 12:12Z", - ) + 12:12:12Z\n2012- 12-12T12: 12:12Z" + )) .conflicts_with_all([NO_EXPIRATION.name]), ) .arg( NO_EXPIRATION .def() - .help( + .help(wrap!( "Force the construction of the transaction without an \ - expiration (highly discouraged).", - ) + expiration (highly discouraged)." + )) .conflicts_with_all([EXPIRATION_OPT.name]), ) .arg( DISPOSABLE_SIGNING_KEY .def() - .help( + .help(wrap!( "Generates an ephemeral, disposable keypair to sign \ the wrapper transaction. This keypair will be \ - immediately discarded after use.", - ) + immediately discarded after use." + )) .requires(FEE_UNSHIELD_SPENDING_KEY.name), ) .arg( SIGNING_KEYS .def() - .help( + .help(wrap!( "Sign the transaction with the key for the given \ public key, public key hash or alias from your \ - wallet.", - ) + wallet." + )) .conflicts_with_all([SIGNATURES.name]), ) .arg( SIGNATURES .def() - .help( + .help(wrap!( "List of file paths containing a serialized signature \ to be attached to a transaction. Requires to provide \ - a gas payer.", - ) + a gas payer." + )) .conflicts_with_all([SIGNING_KEYS.name]) .requires(FEE_PAYER_OPT.name), ) - .arg(OUTPUT_FOLDER_PATH.def().help( - "The output folder path where the artifact will be stored.", - )) - .arg(CHAIN_ID_OPT.def().help("The chain ID.")) + .arg(OUTPUT_FOLDER_PATH.def().help(wrap!( + "The output folder path where the artifact will be stored." + ))) + .arg(CHAIN_ID_OPT.def().help(wrap!("The chain ID."))) .arg( FEE_PAYER_OPT .def() - .help( + .help(wrap!( "The implicit address of the gas payer. It defaults \ to the address associated to the first key passed to \ - --signing-keys.", - ) + --signing-keys." + )) .conflicts_with(DISPOSABLE_SIGNING_KEY.name), ) - .arg(USE_DEVICE.def().help( + .arg(USE_DEVICE.def().help(wrap!( "Use an attached hardware wallet device to sign the \ - transaction.", - )) + transaction." + ))) .arg( MEMO_OPT .def() - .help("Attach a plaintext memo to the transaction."), + .help(wrap!("Attach a plaintext memo to the transaction.")), ) } @@ -6724,15 +6778,13 @@ pub mod args { } fn def(app: App) -> App { - app.arg( - ALIAS.def().help( - "An alias to be associated with the payment address.", - ), - ) - .arg(ALIAS_FORCE.def().help( - "Override the alias without confirmation if it already exists.", - )) - .arg(VIEWING_KEY.def().help("The viewing key.")) + app.arg(ALIAS.def().help(wrap!( + "An alias to be associated with the payment address." + ))) + .arg(ALIAS_FORCE.def().help(wrap!( + "Override the alias without confirmation if it already exists." + ))) + .arg(VIEWING_KEY.def().help(wrap!("The viewing key."))) } } @@ -6763,59 +6815,57 @@ pub mod args { } fn def(app: App) -> App { - app.arg(SCHEME.def().conflicts_with(SHIELDED.name).help( + app.arg(SCHEME.def().conflicts_with(SHIELDED.name).help(wrap!( "For the transparent pool, the type of key that should be \ derived. Argument must be either ed25519 or secp256k1. If \ none provided, the default key scheme is ed25519.\nNot \ - applicable for the shielded pool.", - )) + applicable for the shielded pool." + ))) .arg( - SHIELDED - .def() - .help("Derive a spending key for the shielded pool."), + SHIELDED.def().help(wrap!( + "Derive a spending key for the shielded pool." + )), ) - .arg(ALIAS.def().help("The key and address alias.")) + .arg(ALIAS.def().help(wrap!("The key and address alias."))) .arg( - ALIAS_FORCE - .def() - .help("Force overwrite the alias if it already exists."), + ALIAS_FORCE.def().help(wrap!( + "Force overwrite the alias if it already exists." + )), ) - .arg(UNSAFE_DONT_ENCRYPT.def().help( + .arg(UNSAFE_DONT_ENCRYPT.def().help(wrap!( "UNSAFE: Do not encrypt the keypair. Do not use this for keys \ - used in a live network.", - )) - .arg(USE_DEVICE.def().help( + used in a live network." + ))) + .arg(USE_DEVICE.def().help(wrap!( "Derive an address and public key from the seed stored on the \ - connected hardware wallet.", - )) - .arg(HD_DERIVATION_PATH.def().help( + connected hardware wallet." + ))) + .arg(HD_DERIVATION_PATH.def().help(wrap!( "HD key derivation path. Use keyword `default` to refer to a \ scheme default path:\n- m/44'/60'/0'/0/0 for the transparent \ secp256k1 scheme\n- m/44'/877'/0'/0'/0' for the transparent \ ed25519 scheme\n- m/32'/877'/0' for the shielded \ setting\nFor ed25519 scheme, all path indices will be \ promoted to hardened indexes. If none is specified, the \ - scheme default path is used.", - )) - .arg(HD_ALLOW_NON_COMPLIANT_DERIVATION_PATH.def().help( + scheme default path is used." + ))) + .arg(HD_ALLOW_NON_COMPLIANT_DERIVATION_PATH.def().help(wrap!( "Allow non-compliant HD derivation path. The compliant \ derivation path schemes include:\n- \ m/44'/60'/account'/change/address_index for the transparent \ secp256k1 scheme\n- \ m/44'/877'/account'/change'/address_index' for the \ transparent ed25519 scheme\n- m/32'/877'/account' and\n- \ - m/32'/877'/account'/address_index for the shielded setting", - )) + m/32'/877'/account'/address_index for the shielded setting" + ))) .group( ArgGroup::new("requires_group") .args([HD_ALLOW_NON_COMPLIANT_DERIVATION_PATH.name]) .requires(HD_DERIVATION_PATH.name), ) - .arg( - HD_PROMPT_BIP39_PASSPHRASE.def().help( - "Use an additional passphrase for HD-key generation.", - ), - ) + .arg(HD_PROMPT_BIP39_PASSPHRASE.def().help(wrap!( + "Use an additional passphrase for HD-key generation." + ))) } } @@ -6846,62 +6896,60 @@ pub mod args { } fn def(app: App) -> App { - app.arg(SCHEME.def().conflicts_with(SHIELDED.name).help( + app.arg(SCHEME.def().conflicts_with(SHIELDED.name).help(wrap!( "For the transparent pool, the type of key that should be \ generated. Argument must be either ed25519 or secp256k1. If \ none provided, the default key scheme is ed25519.\nNot \ - applicable for the shielded pool.", - )) + applicable for the shielded pool." + ))) .arg( - SHIELDED - .def() - .help("Generate a spending key for the shielded pool."), + SHIELDED.def().help(wrap!( + "Generate a spending key for the shielded pool." + )), ) .arg( RAW_KEY_GEN .def() .conflicts_with(HD_DERIVATION_PATH.name) - .help( + .help(wrap!( "Generate a random non-HD secret / spending key. No \ - mnemonic code is generated.", - ), + mnemonic code is generated." + )), ) - .arg(ALIAS.def().help("The key and address alias.")) - .arg(ALIAS_FORCE.def().help( - "Override the alias without confirmation if it already exists.", - )) - .arg(UNSAFE_DONT_ENCRYPT.def().help( + .arg(ALIAS.def().help(wrap!("The key and address alias."))) + .arg(ALIAS_FORCE.def().help(wrap!( + "Override the alias without confirmation if it already exists." + ))) + .arg(UNSAFE_DONT_ENCRYPT.def().help(wrap!( "UNSAFE: Do not encrypt the keypair. Do not use this for keys \ - used in a live network.", - )) - .arg(HD_DERIVATION_PATH.def().help( + used in a live network." + ))) + .arg(HD_DERIVATION_PATH.def().help(wrap!( "HD key derivation path. Use keyword `default` to refer to a \ scheme default path:\n- m/44'/60'/0'/0/0 for the transparent \ secp256k1 scheme\n- m/44'/877'/0'/0'/0' for the transparent \ ed25519 scheme\n- m/32'/877'/0' for the shielded \ setting\nFor ed25519 scheme, all path indices will be \ promoted to hardened indexes. If none is specified, the \ - scheme default path is used.", - )) - .arg(HD_ALLOW_NON_COMPLIANT_DERIVATION_PATH.def().help( + scheme default path is used." + ))) + .arg(HD_ALLOW_NON_COMPLIANT_DERIVATION_PATH.def().help(wrap!( "Allow non-compliant HD derivation path. The compliant \ derivation path schemes include:\n- \ m/44'/60'/account'/change/address_index for the transparent \ secp256k1 scheme\n- \ m/44'/877'/account'/change'/address_index' for the \ transparent ed25519 scheme\n- m/32'/877'/account' and\n- \ - m/32'/877'/account'/address_index for the shielded setting", - )) + m/32'/877'/account'/address_index for the shielded setting" + ))) .group( ArgGroup::new("requires_group") .args([HD_ALLOW_NON_COMPLIANT_DERIVATION_PATH.name]) .requires(HD_DERIVATION_PATH.name), ) - .arg( - HD_PROMPT_BIP39_PASSPHRASE.def().help( - "Use an additional passphrase for HD-key generation.", - ), - ) + .arg(HD_PROMPT_BIP39_PASSPHRASE.def().help(wrap!( + "Use an additional passphrase for HD-key generation." + ))) } } @@ -6927,28 +6975,34 @@ pub mod args { app.arg( TRANSPARENT .def() - .help("List transparent keys / addresses only."), - ) - .arg( - SHIELDED - .def() - .help("List keys / addresses of the shielded pool only."), + .help(wrap!("List transparent keys / addresses only.")), ) + .arg(SHIELDED.def().help(wrap!( + "List keys / addresses of the shielded pool only." + ))) .group( ArgGroup::new("only_group_1") .args([TRANSPARENT.name, SHIELDED.name]), ) - .arg(LIST_FIND_KEYS_ONLY.def().help("List keys only.")) - .arg(LIST_FIND_ADDRESSES_ONLY.def().help("List addresses only.")) + .arg(LIST_FIND_KEYS_ONLY.def().help(wrap!("List keys only."))) + .arg( + LIST_FIND_ADDRESSES_ONLY + .def() + .help(wrap!("List addresses only.")), + ) .group(ArgGroup::new("only_group_2").args([ LIST_FIND_KEYS_ONLY.name, LIST_FIND_ADDRESSES_ONLY.name, ])) - .arg(DECRYPT.def().help("Decrypt keys that are encrypted.")) + .arg( + DECRYPT + .def() + .help(wrap!("Decrypt keys that are encrypted.")), + ) .arg( UNSAFE_SHOW_SECRET .def() - .help("UNSAFE: Print the secret / spending keys."), + .help(wrap!("UNSAFE: Print the secret / spending keys.")), ) } } @@ -6979,26 +7033,22 @@ pub mod args { fn def(app: App) -> App { app.arg( - ALIAS_OPT - .def() - .help("An alias associated with the keys / addresses."), - ) - .arg( - RAW_ADDRESS_OPT.def().help( - "The bech32m encoded string of a transparent address.", - ), - ) - .arg( - RAW_PUBLIC_KEY_OPT.def().help( - "A public key associated with the transparent keypair.", - ), + ALIAS_OPT.def().help(wrap!( + "An alias associated with the keys / addresses." + )), ) - .arg(RAW_PUBLIC_KEY_HASH_OPT.def().help( - "A public key hash associated with the transparent keypair.", - )) - .arg(RAW_PAYMENT_ADDRESS_OPT.def().help( - "The bech32m encoded string of a shielded payment address.", - )) + .arg(RAW_ADDRESS_OPT.def().help(wrap!( + "The bech32m encoded string of a transparent address." + ))) + .arg(RAW_PUBLIC_KEY_OPT.def().help(wrap!( + "A public key associated with the transparent keypair." + ))) + .arg(RAW_PUBLIC_KEY_HASH_OPT.def().help(wrap!( + "A public key hash associated with the transparent keypair." + ))) + .arg(RAW_PAYMENT_ADDRESS_OPT.def().help(wrap!( + "The bech32m encoded string of a shielded payment address." + ))) .group( ArgGroup::new("addr_find_args") .args([ @@ -7010,21 +7060,29 @@ pub mod args { ]) .required(true), ) - .arg(LIST_FIND_KEYS_ONLY.def().help("Find keys only.")) - .arg(LIST_FIND_ADDRESSES_ONLY.def().help("Find addresses only.")) + .arg(LIST_FIND_KEYS_ONLY.def().help(wrap!("Find keys only."))) + .arg( + LIST_FIND_ADDRESSES_ONLY + .def() + .help(wrap!("Find addresses only.")), + ) .group(ArgGroup::new("only_group").args([ LIST_FIND_KEYS_ONLY.name, LIST_FIND_ADDRESSES_ONLY.name, ])) - .arg(PRE_GENESIS.def().help( + .arg(PRE_GENESIS.def().help(wrap!( "Use pre-genesis wallet, instead of for the current chain, if \ - any.", - )) - .arg(DECRYPT.def().help("Decrypt keys that are encrypted.")) + any." + ))) + .arg( + DECRYPT + .def() + .help(wrap!("Decrypt keys that are encrypted.")), + ) .arg( UNSAFE_SHOW_SECRET .def() - .help("UNSAFE: Print the secret / spending key."), + .help(wrap!("UNSAFE: Print the secret / spending key.")), ) } } @@ -7045,23 +7103,23 @@ pub mod args { fn def(app: App) -> App { app.arg( - ALIAS - .def() - .help("An alias to be associated with the new entry."), + ALIAS.def().help(wrap!( + "An alias to be associated with the new entry." + )), ) - .arg(ALIAS_FORCE.def().help( - "Override the alias without confirmation if it already exists.", - )) - .arg(VALUE.def().help( + .arg(ALIAS_FORCE.def().help(wrap!( + "Override the alias without confirmation if it already exists." + ))) + .arg(VALUE.def().help(wrap!( "Any value of the following:\n- transparent pool secret \ key\n- transparent pool public key\n- transparent pool \ address\n- shielded pool spending key\n- shielded pool \ - viewing key\n- shielded pool payment address ", - )) - .arg(UNSAFE_DONT_ENCRYPT.def().help( + viewing key\n- shielded pool payment address " + ))) + .arg(UNSAFE_DONT_ENCRYPT.def().help(wrap!( "UNSAFE: Do not encrypt the added keys. Do not use this for \ - keys used in a live network.", - )) + keys used in a live network." + ))) } } @@ -7073,8 +7131,13 @@ pub mod args { } fn def(app: App) -> App { - app.arg(ALIAS.def().help("An alias to be removed.")) - .arg(DO_IT.def().help("Confirm alias removal.").required(true)) + app.arg(ALIAS.def().help(wrap!("An alias to be removed."))) + .arg( + DO_IT + .def() + .help(wrap!("Confirm alias removal.")) + .required(true), + ) } } @@ -7086,7 +7149,9 @@ pub mod args { fn def(app: App) -> App { app.arg( - ALIAS.def().help("The alias of the key you wish to export."), + ALIAS + .def() + .help(wrap!("The alias of the key you wish to export.")), ) } } @@ -7099,7 +7164,9 @@ pub mod args { fn def(app: App) -> App { app.arg( - ALIAS.def().help("The alias of the key you wish to export."), + ALIAS + .def() + .help(wrap!("The alias of the key you wish to export.")), ) } } @@ -7119,19 +7186,17 @@ pub mod args { } fn def(app: App) -> App { - app.arg(FILE_PATH.def().help( - "Path to the file containing the key you wish to import.", - )) - .arg(ALIAS.def().help("The alias assigned to the.")) - .arg( - ALIAS_FORCE - .def() - .help("An alias to be associated with the imported entry."), - ) - .arg(UNSAFE_DONT_ENCRYPT.def().help( + app.arg(FILE_PATH.def().help(wrap!( + "Path to the file containing the key you wish to import." + ))) + .arg(ALIAS.def().help(wrap!("The alias assigned to the."))) + .arg(ALIAS_FORCE.def().help(wrap!( + "An alias to be associated with the imported entry." + ))) + .arg(UNSAFE_DONT_ENCRYPT.def().help(wrap!( "UNSAFE: Do not encrypt the imported keys. Do not use this \ - for keys used in a live network.", - )) + for keys used in a live network." + ))) } } @@ -7164,16 +7229,16 @@ pub mod args { } fn def(app: App) -> App { - app.arg(CHAIN_ID.def().help("The chain ID. The chain must be known in the repository: \ - https://github.com/heliaxdev/anoma-network-config")) - .arg(GENESIS_VALIDATOR.def().help("The alias of the genesis validator that you want to set up as, if any.")) - .arg(PRE_GENESIS_PATH.def().help("The path to the pre-genesis directory for genesis validator, if any. Defaults to \"{base-dir}/pre-genesis/{genesis-validator}\".")) - .arg(DONT_PREFETCH_WASM.def().help( - "Do not pre-fetch WASM.", + app.arg(CHAIN_ID.def().help(wrap!("The chain ID. The chain must be known in the repository: \ + https://github.com/heliaxdev/anoma-network-config"))) + .arg(GENESIS_VALIDATOR.def().help(wrap!("The alias of the genesis validator that you want to set up as, if any."))) + .arg(PRE_GENESIS_PATH.def().help(wrap!("The path to the pre-genesis directory for genesis validator, if any. Defaults to \"{base-dir}/pre-genesis/{genesis-validator}\"."))) + .arg(DONT_PREFETCH_WASM.def().help(wrap!( + "Do not pre-fetch WASM.") )) - .arg(ALLOW_DUPLICATE_IP.def().help( + .arg(ALLOW_DUPLICATE_IP.def().help(wrap!( "Toggle to disable guard against peers connecting from the \ - same IP. This option shouldn't be used in mainnet.", + same IP. This option shouldn't be used in mainnet.") )) .arg(ADD_PERSISTENT_PEERS.def().help( "Whether to add persistent peers to the P2P config of CometBFT, \ @@ -7194,10 +7259,10 @@ pub mod args { } fn def(app: App) -> App { - app.arg(RAW_PUBLIC_KEY.def().help( + app.arg(RAW_PUBLIC_KEY.def().help(wrap!( "The consensus public key to be converted to Tendermint \ - address.", - )) + address." + ))) } } @@ -7229,7 +7294,7 @@ pub mod args { app.arg( CODE_PATH .def() - .help("The path to the wasm file to validate."), + .help(wrap!("The path to the wasm file to validate.")), ) } } @@ -7264,31 +7329,31 @@ pub mod args { } fn def(app: App) -> App { - app.arg(TEMPLATES_PATH.def().help( + app.arg(TEMPLATES_PATH.def().help(wrap!( "Path to the directory with genesis templates to be used to \ - initialize the network.", - )) + initialize the network." + ))) .arg( WASM_CHECKSUMS_PATH .def() - .help("Path to the WASM checksums file."), + .help(wrap!("Path to the WASM checksums file.")), ) - .arg(CHAIN_ID_PREFIX.def().help( + .arg(CHAIN_ID_PREFIX.def().help(wrap!( "The chain ID prefix. Up to 19 alphanumeric, '.', '-' or '_' \ - characters.", - )) - .arg(GENESIS_TIME.def().help( + characters." + ))) + .arg(GENESIS_TIME.def().help(wrap!( "The start time of the network in RFC 3339 and ISO 8601 \ - format. For example: \"2021-12-31T00:00:00Z\".", - )) - .arg(CONSENSUS_TIMEOUT_COMMIT.def().help( + format. For example: \"2021-12-31T00:00:00Z\"." + ))) + .arg(CONSENSUS_TIMEOUT_COMMIT.def().help(wrap!( "The Tendermint consensus timeout_commit configuration as \ - e.g. `1s` or `1000ms`. Defaults to 10 seconds.", - )) - .arg(ARCHIVE_DIR.def().help( + e.g. `1s` or `1000ms`. Defaults to 10 seconds." + ))) + .arg(ARCHIVE_DIR.def().help(wrap!( "Specify a directory into which to store the archive. Default \ - is the current working directory.", - )) + is the current working directory." + ))) } } @@ -7304,7 +7369,9 @@ pub mod args { } fn def(app: App) -> App { - app.arg(PATH.def().help("Path to the genesis txs toml file.")) + app.arg( + PATH.def().help(wrap!("Path to the genesis txs toml file.")), + ) } } @@ -7332,22 +7399,22 @@ pub mod args { } fn def(app: App) -> App { - app.arg(ALIAS_MANY.def().help( + app.arg(ALIAS_MANY.def().help(wrap!( "Comma separated list of aliases of the keys to use from the \ - wallet.", - )) - .arg(THRESHOLD.def().help( + wallet." + ))) + .arg(THRESHOLD.def().help(wrap!( "The minimum number of signatures to be provided for \ authorization. Must be less than or equal to the maximum \ - number of key aliases provided.", - )) - .arg(VP.def().help( - "The validity predicate of the account. Defaults to `vp_user`.", - )) - .arg(PATH.def().help( + number of key aliases provided." + ))) + .arg(VP.def().help(wrap!( + "The validity predicate of the account. Defaults to `vp_user`." + ))) + .arg(PATH.def().help(wrap!( "The path of the .toml file to write the established account \ - transaction to. Overwrites the file if it exists.", - )) + transaction to. Overwrites the file if it exists." + ))) } } @@ -7377,16 +7444,24 @@ pub mod args { } fn def(app: App) -> App { - app.arg(GENESIS_VALIDATOR_ADDRESS.def().help("Validator address.")) - .arg(AMOUNT.def().help("Amount of tokens to stake in a bond.")) - .arg(GENESIS_BOND_SOURCE.def().help( - "Source address for delegations. For self-bonds, the \ - validator is also the source.", - )) - .arg( - PATH.def() - .help("Output toml file to write transactions to."), - ) + app.arg( + GENESIS_VALIDATOR_ADDRESS + .def() + .help(wrap!("Validator address.")), + ) + .arg( + AMOUNT + .def() + .help(wrap!("Amount of tokens to stake in a bond.")), + ) + .arg(GENESIS_BOND_SOURCE.def().help(wrap!( + "Source address for delegations. For self-bonds, the \ + validator is also the source." + ))) + .arg( + PATH.def() + .help(wrap!("Output toml file to write transactions to.")), + ) } } @@ -7448,64 +7523,62 @@ pub mod args { } fn def(app: App) -> App { - app.arg(ALIAS.def().help("The validator address alias.")) - .arg(RAW_ADDRESS_ESTABLISHED.def().help( + app.arg(ALIAS.def().help(wrap!("The validator address alias."))) + .arg(RAW_ADDRESS_ESTABLISHED.def().help(wrap!( "The address of an established account to be promoted to \ - a validator.", - )) - .arg(PATH.def().help( + a validator." + ))) + .arg(PATH.def().help(wrap!( "The .toml file containing an established account tx from \ - which to create a validator.", - )) - .arg(NET_ADDRESS.def().help( + which to create a validator." + ))) + .arg(NET_ADDRESS.def().help(wrap!( "Static {host:port} of your validator node's P2P address. \ Namada uses port `26656` for P2P connections by default, \ - but you can configure a different value.", - )) - .arg(COMMISSION_RATE.def().help( + but you can configure a different value." + ))) + .arg(COMMISSION_RATE.def().help(wrap!( "The commission rate charged by the validator for \ - delegation rewards. This is a required parameter.", - )) - .arg(MAX_COMMISSION_RATE_CHANGE.def().help( + delegation rewards. This is a required parameter." + ))) + .arg(MAX_COMMISSION_RATE_CHANGE.def().help(wrap!( "The maximum change per epoch in the commission rate \ charged by the validator for delegation rewards. This is \ - a required parameter.", - )) - .arg(UNSAFE_DONT_ENCRYPT.def().help( + a required parameter." + ))) + .arg(UNSAFE_DONT_ENCRYPT.def().help(wrap!( "UNSAFE: Do not encrypt the generated keypairs. Do not \ - use this for keys used in a live network.", - )) - .arg(SCHEME.def().help( + use this for keys used in a live network." + ))) + .arg(SCHEME.def().help(wrap!( "The key scheme/type used for the validator keys. \ - Currently supports ed25519 and secp256k1.", - )) - .arg( - SELF_BOND_AMOUNT.def().help( - "The amount of native token to self-bond in PoS.", - ), - ) - .arg(EMAIL.def().help( + Currently supports ed25519 and secp256k1." + ))) + .arg(SELF_BOND_AMOUNT.def().help(wrap!( + "The amount of native token to self-bond in PoS." + ))) + .arg(EMAIL.def().help(wrap!( "The email address of the validator. This is a required \ - parameter.", - )) - .arg(DESCRIPTION_OPT.def().help( + parameter." + ))) + .arg(DESCRIPTION_OPT.def().help(wrap!( "The validator's description. This is an optional \ - parameter.", - )) - .arg(WEBSITE_OPT.def().help( - "The validator's website. This is an optional parameter.", - )) - .arg(DISCORD_OPT.def().help( + parameter." + ))) + .arg(WEBSITE_OPT.def().help(wrap!( + "The validator's website. This is an optional parameter." + ))) + .arg(DISCORD_OPT.def().help(wrap!( "The validator's discord handle. This is an optional \ - parameter.", - )) - .arg(AVATAR_OPT.def().help( - "The validator's avatar. This is an optional parameter.", - )) - .arg(VALIDATOR_NAME_OPT.def().help( + parameter." + ))) + .arg(AVATAR_OPT.def().help(wrap!( + "The validator's avatar. This is an optional parameter." + ))) + .arg(VALIDATOR_NAME_OPT.def().help(wrap!( "The validator's name, used to identify the validator in \ - online services. This is an optional parameter.", - )) + online services. This is an optional parameter." + ))) } } @@ -7523,8 +7596,9 @@ pub mod args { fn def(app: App) -> App { app.arg( - PATH.def() - .help("Path to the directory with the template files."), + PATH.def().help(wrap!( + "Path to the directory with the template files." + )), ) } } @@ -7545,13 +7619,14 @@ pub mod args { fn def(app: App) -> App { app.arg( - PATH.def() - .help("Path to the directory with the template files."), + PATH.def().help(wrap!( + "Path to the directory with the template files." + )), ) - .arg(WASM_DIR.def().help( + .arg(WASM_DIR.def().help(wrap!( "Optional wasm directory to provide as part of verifying \ - genesis template files", - )) + genesis template files" + ))) } } @@ -7579,22 +7654,23 @@ pub mod args { fn def(app: App) -> App { app.arg( - PATH.def() - .help("Path to the unsigned transactions TOML file."), + PATH.def().help(wrap!( + "Path to the unsigned transactions TOML file." + )), ) - .arg(OUTPUT.def().help( + .arg(OUTPUT.def().help(wrap!( "Save the output to a TOML file. When not supplied, the \ - signed transactions will be printed to stdout instead.", - )) + signed transactions will be printed to stdout instead." + ))) .arg( ALIAS_OPT .def() - .help("Optional alias to a validator wallet."), + .help(wrap!("Optional alias to a validator wallet.")), ) - .arg(USE_DEVICE.def().help( + .arg(USE_DEVICE.def().help(wrap!( "Derive an address and public key from the seed stored on the \ - connected hardware wallet.", - )) + connected hardware wallet." + ))) } } @@ -7611,10 +7687,10 @@ pub mod args { } fn def(app: App) -> App { - app.arg(PATH.def().help( + app.arg(PATH.def().help(wrap!( "Path to the migrations JSON file. Requires the binary to be \ - built with the \"migrations\" feature.", - )) + built with the \"migrations\" feature." + ))) } } } diff --git a/crates/apps/src/lib/cli/utils.rs b/crates/apps/src/lib/cli/utils.rs index ea61718a5c..0ad1197fc6 100644 --- a/crates/apps/src/lib/cli/utils.rs +++ b/crates/apps/src/lib/cli/utils.rs @@ -154,6 +154,12 @@ pub const fn arg_multi(name: &'static str) -> ArgMulti { } } +#[macro_export] +macro_rules! wrap { + ($text:literal) => { + textwrap_macros::fill!($text, 60) + }; +} impl Arg { pub const fn opt(self) -> ArgOpt { ArgOpt {