mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-16 09:11:55 +00:00
cli: use pager for files
The output from `files` is often longer than a screen, so the pager is useful, even though this command is probably used mostly by scripts. As with `status`, `hg` pages its output, but `git` doesn't.
This commit is contained in:
parent
cb9ba5abc1
commit
8e994a28fe
1 changed files with 1 additions and 0 deletions
|
@ -1245,6 +1245,7 @@ fn cmd_files(ui: &mut Ui, command: &CommandHelper, args: &FilesArgs) -> Result<(
|
||||||
let workspace_command = command.workspace_helper(ui)?;
|
let workspace_command = command.workspace_helper(ui)?;
|
||||||
let commit = workspace_command.resolve_single_rev(&args.revision)?;
|
let commit = workspace_command.resolve_single_rev(&args.revision)?;
|
||||||
let matcher = workspace_command.matcher_from_values(&args.paths)?;
|
let matcher = workspace_command.matcher_from_values(&args.paths)?;
|
||||||
|
ui.request_pager();
|
||||||
for (name, _value) in commit.tree().entries_matching(matcher.as_ref()) {
|
for (name, _value) in commit.tree().entries_matching(matcher.as_ref()) {
|
||||||
writeln!(ui, "{}", &workspace_command.format_file_path(&name))?;
|
writeln!(ui, "{}", &workspace_command.format_file_path(&name))?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue