From 28633bb754348bd183654f9e65f9ccb68ad25e1c Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sat, 12 Aug 2023 13:25:42 +0900 Subject: [PATCH] cli: fix --no-pager to persist across layered config loading --- cli/src/cli_util.rs | 2 +- cli/src/ui.rs | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 4dd8cf451..857cc37e4 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -2488,7 +2488,7 @@ fn handle_early_args( args.config_toml.push(format!(r#"ui.color="{choice}""#)); } if args.no_pager.unwrap_or_default() { - ui.set_pagination(crate::ui::PaginationChoice::Never); + args.config_toml.push(r#"ui.paginate="never""#.to_owned()); } if !args.config_toml.is_empty() { layered_configs.parse_config_args(&args.config_toml)?; diff --git a/cli/src/ui.rs b/cli/src/ui.rs index f17274ecf..74922dbed 100644 --- a/cli/src/ui.rs +++ b/cli/src/ui.rs @@ -132,11 +132,6 @@ impl Ui { Ok(()) } - /// Sets the pagination value. - pub fn set_pagination(&mut self, choice: PaginationChoice) { - self.paginate = choice; - } - /// Switches the output to use the pager, if allowed. #[instrument(skip_all)] pub fn request_pager(&mut self) {