Skip to content

Commit

Permalink
fix(cheat): don't use a pager when no cheat sheet found for the command
Browse files Browse the repository at this point in the history
  • Loading branch information
figsoda committed Mar 16, 2023
1 parent 0ab80fe commit 170e8a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/helper/docs/cheat.rs
Expand Up @@ -25,7 +25,11 @@ pub fn show_cheat_sheet<Output: Write>(
.call()
.map_err(|e| Error::from(Box::new(e)))?
.into_string()?;
if let Some(pager) = pager {
// Don't use a pager when the topic is not found.
if let Some(pager) = pager
.as_ref()
.filter(|_| !cheat_sheet.starts_with("Unknown topic."))
{
let mut process = if cfg!(target_os = "windows") {
Command::new("cmd")
.args(["/C", pager])
Expand Down

0 comments on commit 170e8a9

Please sign in to comment.