Skip to content

Commit 8845a50

Browse files
committed
tidy up help strings
1 parent 8b00aae commit 8845a50

File tree

6 files changed

+59
-18
lines changed

6 files changed

+59
-18
lines changed

src/rust-cli/debug.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ use crate::rpc_call::make_rpc_call;
88

99
#[derive(Subcommand, Debug)]
1010
pub enum DebugCommand {
11-
/// Generate the docker-compose file for a given <graph_file> and return it.
12-
GenerateCompose { graph_file_path: PathBuf },
11+
/// Generate the docker-compose file for a given graph_file
12+
GenerateCompose {
13+
/// Path to graph file to generate from
14+
graph_file_path: PathBuf,
15+
},
1316
}
1417

1518
pub async fn handle_debug_command(

src/rust-cli/graph.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,23 @@ use xmltree::{Element, EmitterConfig, XMLNode};
1616

1717
#[derive(Subcommand, Debug)]
1818
pub enum GraphCommand {
19-
/// Create a cycle graph with <number> nodes, and include 7 extra random outbounds per node.
20-
/// Returns XML file as string with or without --outfile option
19+
/// Create a cycle graph with 7 extra random outbounds per node.
2120
Create {
21+
/// Number of nodes in the graph
2222
number: usize,
23+
/// Write graph to a this file path
2324
#[arg(short, long)]
2425
outfile: Option<PathBuf>,
26+
/// Bitcoin Core version to set on nodes
2527
#[arg(short, long)]
2628
version: Option<String>,
29+
/// config values to add to bitcoin.conf
2730
#[arg(short, long)]
2831
bitcoin_conf: Option<PathBuf>,
2932
},
33+
/// (broken) Validate a *.graphml file against the graph schema
3034
Validate {
35+
/// Path to graph file
3136
graph: PathBuf,
3237
},
3338
}

src/rust-cli/image.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,28 @@ use std::process::{Command, Stdio};
55

66
#[derive(Subcommand, Debug)]
77
pub enum ImageCommand {
8-
/// Build bitcoind and bitcoin-cli from <repo>/<branch> as <registry>:<tag>.
8+
/// Build a bitcoind/bitcoin-cli docker image.
99
/// Optionally deploy to remote registry using --action=push, otherwise image is loaded to local registry.
1010
Build {
11+
/// Github repo e.g. bitcoin/bitcoin
1112
#[arg(long)]
1213
repo: String,
14+
/// Branch e.g. v27.0
1315
#[arg(long)]
1416
branch: String,
17+
/// docker registry e.g. user/repo
1518
#[arg(long)]
1619
registry: String,
20+
/// docker image tag(s) to apply e.g. 27.0-warnet
1721
#[arg(long)]
1822
tag: String,
23+
/// Custom Bitcoin Core build args to use
1924
#[arg(long)]
2025
build_args: Option<String>,
26+
/// Arches to build for (multiple arches only supported with action=push)
2127
#[arg(long)]
2228
arches: Option<String>,
29+
/// Load (to local) or push (to remote) registry
2330
#[arg(long)]
2431
action: Option<String>,
2532
},

src/rust-cli/main.rs

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,38 +34,55 @@ enum Commands {
3434
#[command(subcommand)]
3535
command: Option<DebugCommand>,
3636
},
37-
/// Fetch the Bitcoin Core debug log from <node> in [network]
38-
DebugLog { node: u64 },
37+
/// Fetch the Bitcoin Core debug log from a node
38+
DebugLog {
39+
/// Node index (integer)
40+
node: u64,
41+
},
3942
/// Graph commands
4043
Graph {
4144
#[command(subcommand)]
4245
command: Option<GraphCommand>,
4346
},
44-
/// Grep combined logs via fluentd using regex <pattern>
45-
GrepLogs { pattern: String },
47+
/// Grep combined logs using regex
48+
GrepLogs {
49+
/// Pattern to search for (as regex)
50+
pattern: String,
51+
},
4652
/// Build a warnet-ready bitcoind docker image from a github branch
4753
Image {
4854
#[command(subcommand)]
4955
command: Option<ImageCommand>,
5056
},
51-
/// Call lncli <method> [params] on <node> in [network]
57+
/// Call "lncli ..." on a node
5258
LnCli {
59+
/// Node index (integer)
5360
node: u64,
61+
/// lncli method
5462
method: String,
63+
/// Optional arguments to method
5564
params: Option<Vec<String>>,
5665
},
57-
/// Fetch messages sent between <node_a> and <node_b> in [network]
58-
Messages { node_a: u64, node_b: u64 },
66+
/// Fetch bitcoin P2P messages sent between two nodes
67+
Messages {
68+
/// First node
69+
node_a: u64,
70+
/// Second node
71+
node_b: u64,
72+
},
5973
/// Network commands
6074
Network {
6175
#[command(subcommand)]
6276
command: Option<NetworkCommand>,
6377
},
64-
/// Call bitcoin-cli <method> [params] on <node> in [network]
78+
/// Call "bitcoin-cli ..." on a node
6579
Rpc {
80+
/// Node index (integer)
6681
node: u64,
82+
/// bitcoin-cli method
6783
#[arg(allow_hyphen_values = true)]
6884
method: String,
85+
/// Optional arguments to method
6986
params: Option<Vec<String>>,
7087
},
7188
/// Scenario commands

src/rust-cli/network.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ use crate::rpc_call::make_rpc_call;
1010

1111
#[derive(Subcommand, Debug)]
1212
pub enum NetworkCommand {
13-
/// Start a network from a <graph_file>
13+
/// Start a network from a graph_file
1414
Start {
15+
/// Path to graph file
1516
graph_file: PathBuf,
17+
/// Force overwite config dir if already exists
1618
#[arg(long, short)]
1719
force: bool,
1820
},

src/rust-cli/scenarios.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,27 @@ use std::path::PathBuf;
1010
pub enum ScenarioCommand {
1111
/// List available scenarios in the Warnet Test Framework
1212
Available {},
13-
/// Run a scenario from remote repository with <name>
13+
/// Run a scenario file from remote repository (on warnet server)
1414
Run {
15+
/// Scenario name
1516
scenario: String,
17+
/// Arguments to scenario
1618
additional_args: Vec<String>,
1719
},
18-
/// Run a local scenario <file> by sending it to the server
20+
/// Run a local scenario file by sending it to the server
1921
RunFile {
22+
/// Path to scenario file
2023
scenario_path: PathBuf,
24+
/// Arguments to scenario
2125
additional_args: Vec<String>,
2226
},
2327
/// List active scenarios
2428
Active {},
25-
/// Stop a scenario with <PID>
26-
Stop { pid: u64 },
29+
/// Stop a scenario
30+
Stop {
31+
/// PID of scenario to stop
32+
pid: u64,
33+
},
2734
}
2835
async fn handle_available(params: ObjectParams) -> anyhow::Result<()> {
2936
let data = make_rpc_call("scenarios_available", params)

0 commit comments

Comments
 (0)