Skip to content

Commit 6eb427b

Browse files
authored
Remove duplicate cli required_else_help method (payjoin#637)
The payjoin-cli expects some args else it lists a help message for users as a walk through for creating a new payjoin. There were some duplicate functions that were causing some dev confusion so the duplicates were removed. I don't think we can get rid of all 4 instances of this method as we still want the help command to show up if a user doesn't add any arg to receive or send, just that these methods already don't work with `--fee-rate` for example, just a warning is given. This simply removes the unecessary methods, if we want to display the help command if say `--fee-rate` is ommited we would need to restructure the commands to allow for this. closes payjoin#636
2 parents 2851a71 + acf143e commit 6eb427b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

payjoin-cli/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ fn cli() -> ArgMatches {
147147
Command::new("send")
148148
.arg_required_else_help(true)
149149
.arg(arg!(<BIP21> "The `bitcoin:...` payjoin uri to send to"))
150-
.arg_required_else_help(true)
151150
.arg(
152151
Arg::new("fee_rate")
153152
.long("fee-rate")
@@ -159,8 +158,7 @@ fn cli() -> ArgMatches {
159158

160159
let mut receive_cmd = Command::new("receive")
161160
.arg_required_else_help(true)
162-
.arg(arg!(<AMOUNT> "The amount to receive in satoshis").value_parser(parse_amount_in_sat))
163-
.arg_required_else_help(true);
161+
.arg(arg!(<AMOUNT> "The amount to receive in satoshis").value_parser(parse_amount_in_sat));
164162

165163
#[cfg(feature = "v2")]
166164
let mut cmd = cmd.subcommand(Command::new("resume"));

0 commit comments

Comments
 (0)