Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cheat): don't use a pager when no cheat sheet found for the command #10

Merged
merged 1 commit into from Mar 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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