Skip to content

Commit 6b68ae2

Browse files
committed
Fix rendering of help when no command provided
1 parent 7ff4f37 commit 6b68ae2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/cli.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ pub fn run_cli() -> Result<()> {
115115
return Ok(());
116116
}
117117

118-
let Some(command) = cli.command else {
119-
// Output program help in markdown format
120-
let help_str = Cli::command().render_long_help().to_string();
121-
println!("{help_str}");
122-
return Ok(());
123-
};
118+
if let Some(command) = cli.command {
119+
command.execute()?;
120+
} else {
121+
// No command provided. Show help.
122+
Cli::command().print_long_help()?;
123+
}
124124

125-
command.execute()
125+
Ok(())
126126
}
127127

128128
/// Handle the `run` command.

0 commit comments

Comments
 (0)