1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 11:22:30 +01:00

make LESSOPEN support opt-in

This commit is contained in:
Anomalocaridid
2023-09-05 22:40:29 -04:00
committed by Martin Nordholts
parent ac2953c070
commit b56021ffa9
8 changed files with 62 additions and 12 deletions

View File

@@ -282,7 +282,7 @@ impl App {
.unwrap_or_default(),
use_custom_assets: !self.matches.get_flag("no-custom-assets"),
#[cfg(feature = "lessopen")]
use_lessopen: !self.matches.get_flag("no-lessopen"),
use_lessopen: self.matches.get_flag("lessopen"),
})
}

View File

@@ -501,13 +501,21 @@ pub fn build_app(interactive_output: bool) -> Command {
#[cfg(feature = "lessopen")]
{
app = app.arg(
Arg::new("no-lessopen")
.long("no-lessopen")
.action(ArgAction::SetTrue)
.hide(true)
.help("Do not use the $LESSOPEN preprocessor"),
)
app = app
.arg(
Arg::new("lessopen")
.long("lessopen")
.action(ArgAction::SetTrue)
.help("Enable the $LESSOPEN preprocessor"),
)
.arg(
Arg::new("no-lessopen")
.long("no-lessopen")
.action(ArgAction::SetTrue)
.overrides_with("lessopen")
.hide(true)
.help("Disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)"),
)
}
app = app