Skip to content

Commit

Permalink
WIP: Deduplicate subcommand logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fishface60 committed Dec 8, 2021
1 parent fdec4f6 commit ff69a1b
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions examples/multicall_busybox.rs
Expand Up @@ -34,19 +34,17 @@ fn main() {
.subcommand(false_applet());

let matches = app.get_matches();
match matches.subcommand() {
Some(("busybox", cmd)) => {
if cmd.occurrences_of("install") > 0 {
unimplemented!("Make hardlinks to the executable here");
}
match cmd.subcommand() {
Some(("false", _)) => exit(1),
Some(("true", _)) => exit(0),
_ => unreachable!(),
}
let mut subcommand = matches.subcommand();
if let Some(("busybox", cmd)) = subcommand {
if cmd.occurrences_of("install") > 0 {
unimplemented!("Make hardlinks to the executable here");
}
Some(("false", _)) => exit(1),
Some(("true", _)) => exit(0),
_ => unreachable!(),
subcommand = cmd.subcommand();
}
if let Some(("false", _)) = subcommand {
exit(1)
}
if let Some(("true", _)) = subcommand {
exit(0)
}
}

0 comments on commit ff69a1b

Please sign in to comment.