From a70adbcfa376e556d7757099c60d875c6eb347cc Mon Sep 17 00:00:00 2001 From: danda Date: Fri, 12 Jul 2024 06:51:23 -0700 Subject: [PATCH] doc: comment send-to-many outputs parsing --- src/bin/neptune-cli.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/bin/neptune-cli.rs b/src/bin/neptune-cli.rs index 398dc8e9..3831ee29 100644 --- a/src/bin/neptune-cli.rs +++ b/src/bin/neptune-cli.rs @@ -25,10 +25,26 @@ struct TransactionOutput { amount: NeptuneCoins, } +/// We impl FromStr deserialization so that clap can parse the --outputs arg of +/// send-to-many command. +/// +/// We do not bother with serialization via `impl Display` because that is +/// not presently needed and would just be unused code. impl FromStr for TransactionOutput { type Err = anyhow::Error; - // parses address:amount into TransactionOutput{address, amount} + /// parses address:amount into TransactionOutput{address, amount} + /// + /// This is used by the outputs arg of send-to-many command. + /// Usage looks like: + /// + /// ... format: address:amount address:amount ... + /// + /// So each output is space delimited and the two fields are + /// colon delimted. + /// + /// This format was chosen because it should be simple for humans + /// to generate on the command-line. fn from_str(s: &str) -> Result { let parts = s.split(':').collect::>();