Skip to content

Commit fb1cd67

Browse files
authored
Group help options into sections in command help (#2567)
1 parent 630619d commit fb1cd67

12 files changed

Lines changed: 1276 additions & 924 deletions

File tree

FULL_HELP_DOCS.md

Lines changed: 1219 additions & 903 deletions
Large diffs are not rendered by default.

cmd/soroban-cli/src/commands/contract/deploy/asset.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::{
1717
commands::{
1818
global,
1919
txn_result::{TxnEnvelopeResult, TxnResult},
20+
HEADING_TRANSACTION,
2021
},
2122
config::{self, data, network},
2223
rpc::Error as SorobanRpcError,
@@ -91,7 +92,7 @@ pub struct Cmd {
9192
pub alias: Option<AliasName>,
9293

9394
/// Build the transaction and only write the base64 xdr to stdout
94-
#[arg(long)]
95+
#[arg(long, help_heading = HEADING_TRANSACTION)]
9596
pub build_only: bool,
9697
}
9798

cmd/soroban-cli/src/commands/contract/deploy/wasm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use crate::{
2424
contract::{self, arg_parsing, build, id::wasm::get_contract_id, upload},
2525
global,
2626
txn_result::{TxnEnvelopeResult, TxnResult},
27+
HEADING_TRANSACTION,
2728
},
2829
config::{self, data, locator, network},
2930
print::Print,
@@ -66,7 +67,7 @@ pub struct Cmd {
6667
#[command(flatten)]
6768
pub resources: resources::Args,
6869
/// Build the transaction and only write the base64 xdr to stdout
69-
#[arg(long)]
70+
#[arg(long, help_heading = HEADING_TRANSACTION)]
7071
pub build_only: bool,
7172
/// If provided, will be passed to the contract's `__constructor` function with provided arguments for that function as `--arg-name value`
7273
#[arg(last = true, id = "CONTRACT_CONSTRUCTOR_ARGS")]

cmd/soroban-cli/src/commands/contract/extend.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use crate::{
2121
commands::{
2222
global,
2323
txn_result::{TxnEnvelopeResult, TxnResult},
24+
HEADING_TRANSACTION,
2425
},
2526
config::{self, data, locator, network},
2627
key, rpc, wasm, Pwd,
@@ -47,7 +48,7 @@ pub struct Cmd {
4748
pub resources: resources::Args,
4849

4950
/// Build the transaction and only write the base64 xdr to stdout
50-
#[arg(long)]
51+
#[arg(long, help_heading = HEADING_TRANSACTION)]
5152
pub build_only: bool,
5253
}
5354

cmd/soroban-cli/src/commands/contract/invoke.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use crate::{
2424
global,
2525
tx::fetch::fee,
2626
txn_result::{TxnEnvelopeResult, TxnResult},
27+
HEADING_TRANSACTION,
2728
},
2829
config::{self, data, locator, network},
2930
get_spec::{self, get_remote_contract_spec},
@@ -70,7 +71,7 @@ pub struct Cmd {
7071
pub send: Send,
7172

7273
/// Build the transaction and only write the base64 xdr to stdout
73-
#[arg(long)]
74+
#[arg(long, help_heading = HEADING_TRANSACTION)]
7475
pub build_only: bool,
7576
}
7677

cmd/soroban-cli/src/commands/contract/restore.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use crate::{
2020
contract::extend,
2121
global,
2222
txn_result::{TxnEnvelopeResult, TxnResult},
23+
HEADING_TRANSACTION,
2324
},
2425
config::{self, data, locator, network},
2526
key, rpc, wasm, Pwd,
@@ -46,7 +47,7 @@ pub struct Cmd {
4647
pub resources: crate::resources::Args,
4748

4849
/// Build the transaction and only write the base64 xdr to stdout
49-
#[arg(long)]
50+
#[arg(long, help_heading = HEADING_TRANSACTION)]
5051
pub build_only: bool,
5152
}
5253

cmd/soroban-cli/src/commands/contract/upload.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use crate::{
1616
commands::{
1717
global,
1818
txn_result::{TxnEnvelopeResult, TxnResult},
19+
HEADING_TRANSACTION,
1920
},
2021
config::{self, data, network},
2122
key,
@@ -50,7 +51,7 @@ pub struct Cmd {
5051
pub ignore_checks: bool,
5152

5253
/// Build the transaction and only write the base64 xdr to stdout
53-
#[arg(long)]
54+
#[arg(long, help_heading = HEADING_TRANSACTION)]
5455
pub build_only: bool,
5556

5657
/// Package to build when --wasm is not provided

cmd/soroban-cli/src/commands/message/sign.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use clap::Parser;
55
use sha2::{Digest, Sha256};
66

77
use crate::{
8-
commands::global,
8+
commands::{global, HEADING_SIGNING},
99
config::{locator, secret},
1010
print::Print,
1111
signer::{self, Signer},
@@ -57,10 +57,15 @@ pub struct Cmd {
5757

5858
// @dev: Ledger and Lab don't support signing arbitrary messages yet. Once they do, use `sign_with::Args` here.
5959
/// Sign with a local key or key saved in OS secure storage. Can be an identity (--sign-with-key alice), a secret key (--sign-with-key SC36…), or a seed phrase (--sign-with-key "kite urban…"). If using seed phrase, `--hd-path` defaults to the `0` path.
60-
#[arg(long, env = "STELLAR_SIGN_WITH_KEY", hide_env_values = true)]
60+
#[arg(
61+
long,
62+
env = "STELLAR_SIGN_WITH_KEY",
63+
hide_env_values = true,
64+
help_heading = HEADING_SIGNING
65+
)]
6166
pub sign_with_key: String,
6267

63-
#[arg(long)]
68+
#[arg(long, help_heading = HEADING_SIGNING)]
6469
/// If using a seed phrase to sign, sets which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0`
6570
pub hd_path: Option<usize>,
6671

cmd/soroban-cli/src/commands/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ pub mod version;
2626

2727
pub mod txn_result;
2828

29-
pub const HEADING_RPC: &str = "Options (RPC)";
30-
pub const HEADING_ARCHIVE: &str = "Options (Archive)";
31-
pub const HEADING_GLOBAL: &str = "Options (Global)";
29+
pub const HEADING_RPC: &str = "RPC Options";
30+
pub const HEADING_ARCHIVE: &str = "Archive Options";
31+
pub const HEADING_GLOBAL: &str = "Global Options";
32+
pub const HEADING_SIGNING: &str = "Signing Options";
33+
pub const HEADING_TRANSACTION: &str = "Transaction Options";
3234
const ABOUT: &str =
3335
"Work seamlessly with Stellar accounts, contracts, and assets from the command line.
3436

cmd/soroban-cli/src/commands/tx/args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::{
2-
commands::{global, txn_result::TxnEnvelopeResult},
2+
commands::{global, txn_result::TxnEnvelopeResult, HEADING_TRANSACTION},
33
config::{
44
self,
55
address::{self, UnresolvedMuxedAccount},
@@ -16,7 +16,7 @@ pub struct Args {
1616
#[clap(flatten)]
1717
pub config: config::Args,
1818
/// Build the transaction and only write the base64 xdr to stdout
19-
#[arg(long)]
19+
#[arg(long, help_heading = HEADING_TRANSACTION)]
2020
pub build_only: bool,
2121
}
2222

0 commit comments

Comments
 (0)