From 7ce010d9edf6d82f7013af2c711308f38fc680d6 Mon Sep 17 00:00:00 2001 From: Oliver looney Date: Thu, 8 Feb 2024 21:33:03 +0000 Subject: [PATCH] Using hypens instead of underscores for set-terminal-title command --- doc/long-help.txt | 2 +- src/bin/bat/app.rs | 2 +- src/bin/bat/clap_app.rs | 4 ++-- tests/integration_tests.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/long-help.txt b/doc/long-help.txt index 700f547b..3ac4a40f 100644 --- a/doc/long-help.txt +++ b/doc/long-help.txt @@ -160,7 +160,7 @@ Options: --acknowledgements Show acknowledgements. - --set_terminal_title + --set-terminal-title Sets terminal title to filenames when using a pager. -h, --help diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs index ef22e93d..8ec3caa5 100644 --- a/src/bin/bat/app.rs +++ b/src/bin/bat/app.rs @@ -287,7 +287,7 @@ impl App { use_custom_assets: !self.matches.get_flag("no-custom-assets"), #[cfg(feature = "lessopen")] use_lessopen: self.matches.get_flag("lessopen"), - set_terminal_title: self.matches.get_flag("set_terminal_title"), + set_terminal_title: self.matches.get_flag("set-terminal-title"), }) } diff --git a/src/bin/bat/clap_app.rs b/src/bin/bat/clap_app.rs index 3f83bf63..6ceed784 100644 --- a/src/bin/bat/clap_app.rs +++ b/src/bin/bat/clap_app.rs @@ -569,8 +569,8 @@ pub fn build_app(interactive_output: bool) -> Command { .help("Show acknowledgements."), ) .arg( - Arg::new("set_terminal_title") - .long("set_terminal_title") + Arg::new("set-terminal-title") + .long("set-terminal-title") .action(ArgAction::SetTrue) .hide_short_help(true) .help("Sets terminal title to filenames when using a pager."), diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index dd670399..1ba51d19 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -927,7 +927,7 @@ fn pager_set_terminal_title() { bat() .env("PAGER", mocked_pagers::from("echo pager-output")) .arg("--paging=always") - .arg("--set_terminal_title") + .arg("--set-terminal-title") .arg("test.txt") .assert() .success()