Skip to content

Commit

Permalink
Show an error if the list of pages would be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
acuteenvy committed Jan 1, 2025
1 parent 6c72977 commit 79e42c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ impl<'a> Cache<'a> {
}

fn print_basenames(mut pages: Vec<OsString>) -> Result<()> {
if pages.is_empty() {
return Err(Error::new("no pages found. Please run 'tldr --update'."));
}

// Show pages in alphabetical order.
pages.sort_unstable();
// There are pages with the same name across multiple platforms.
Expand Down

0 comments on commit 79e42c9

Please sign in to comment.