From 8e994a28fef528d965c2ba0339338212880d9f0c Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 4 Dec 2022 06:14:38 -0800 Subject: [PATCH] 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. --- src/commands.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands.rs b/src/commands.rs index 7616fca2a..55c5e93c2 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1245,6 +1245,7 @@ fn cmd_files(ui: &mut Ui, command: &CommandHelper, args: &FilesArgs) -> Result<( let workspace_command = command.workspace_helper(ui)?; let commit = workspace_command.resolve_single_rev(&args.revision)?; let matcher = workspace_command.matcher_from_values(&args.paths)?; + ui.request_pager(); for (name, _value) in commit.tree().entries_matching(matcher.as_ref()) { writeln!(ui, "{}", &workspace_command.format_file_path(&name))?; }