Skip to content

Commit e4b8ef7

Browse files
committed
Use new function in implementation of list subcommand
1 parent 0410347 commit e4b8ef7

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/main.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -317,24 +317,16 @@ fn list_impl(matches: &clap::ArgMatches) {
317317
issues.truncate(str::parse(number).unwrap_or_abort());
318318
}
319319

320-
// spawn a pager
321-
let mut pager = system::programs::pager(repo.config().unwrap_or_abort())
322-
.unwrap_or_abort();
323-
324-
issues
320+
// present the list to the user
321+
let result = issues
325322
.into_iter()
326323
.map(|issue| issue.initial_message())
327324
.abort_on_err()
328325
.flat_map(|initial| formatter.iter().formatted_lines(initial))
329326
.abort_on_err()
330-
.write_lines(pager.stdin.as_mut().unwrap())
327+
.pipe_lines(repo.pager())
331328
.unwrap_or_abort();
332-
333-
// don't trash the shell by exitting with a child still printing to it
334-
let result = pager.wait().unwrap_or_abort();
335-
if !result.success() {
336-
std::process::exit(result.code().unwrap_or(1));
337-
}
329+
std::process::exit(result);
338330
}
339331

340332

0 commit comments

Comments
 (0)