Skip to content

Commit f46c5f6

Browse files
committed
Rename subcommand of parsed clap data structure
1 parent 75bdb3b commit f46c5f6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const HELP: &str = "\
3333
)]
3434
struct Opt {
3535
#[clap(subcommand)]
36-
serve: Option<Subcommand>,
36+
subcommand: Option<Subcommand>,
3737
}
3838

3939
#[derive(ClapSubcommand, Debug)]
@@ -60,9 +60,12 @@ async fn main() {
6060

6161
report(render::main());
6262

63-
if opt.serve.is_some() {
64-
let _ = writeln!(io::stderr());
65-
report(serve::main().await);
63+
match opt.subcommand {
64+
None => {}
65+
Some(Subcommand::Serve) => {
66+
let _ = writeln!(io::stderr());
67+
report(serve::main().await);
68+
}
6669
}
6770
}
6871

0 commit comments

Comments
 (0)