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:
committed by
Martin Nordholts
parent
ac2953c070
commit
b56021ffa9
@@ -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"),
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user