summaryrefslogtreecommitdiffstats
path: root/assets
diff options
context:
space:
mode:
authorAnomalocaridid <29845794+Anomalocaridid@users.noreply.github.com>2023-09-05 22:40:29 -0400
committerMartin Nordholts <enselic@gmail.com>2023-09-08 06:25:20 +0200
commitb56021ffa991b55c40428ee0af77a8d345cce85f (patch)
tree509a605ac8a3440083553007f20691bf50fafd8a /assets
parentac2953c070b4d62b5fb573a0e9fee2b6712f073c (diff)
make LESSOPEN support opt-in
Diffstat (limited to 'assets')
-rw-r--r--assets/completions/_bat.ps1.in3
-rw-r--r--assets/completions/bat.bash.in2
-rw-r--r--assets/completions/bat.fish.in2
-rw-r--r--assets/completions/bat.zsh.in3
-rw-r--r--assets/manual/bat.1.in8
5 files changed, 15 insertions, 3 deletions
diff --git a/assets/completions/_bat.ps1.in b/assets/completions/_bat.ps1.in
index fe0b8b07..c0c151e1 100644
--- a/assets/completions/_bat.ps1.in
+++ b/assets/completions/_bat.ps1.in
@@ -59,7 +59,8 @@ Register-ArgumentCompleter -Native -CommandName '{{PROJECT_EXECUTABLE}}' -Script
[CompletionResult]::new('--unbuffered', 'unbuffered', [CompletionResultType]::ParameterName, 'unbuffered')
[CompletionResult]::new('--no-config', 'no-config', [CompletionResultType]::ParameterName, 'Do not use the configuration file')
[CompletionResult]::new('--no-custom-assets', 'no-custom-assets', [CompletionResultType]::ParameterName, 'Do not load custom assets')
- [CompletionResult]::new('--no-lessopen', 'no-lessopen', [CompletionResultType]::ParameterName, 'Do not use the $LESSOPEN preprocessor')
+ [CompletionResult]::new('--lessopen', 'lessopen', [CompletionResultType]::ParameterName, 'Enable the $LESSOPEN preprocessor')
+ [CompletionResult]::new('--no-lessopen', 'no-lessopen', [CompletionResultType]::ParameterName, 'Disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)')
[CompletionResult]::new('--config-file', 'config-file', [CompletionResultType]::ParameterName, 'Show path to the configuration file.')
[CompletionResult]::new('--generate-config-file', 'generate-config-file', [CompletionResultType]::ParameterName, 'Generates a default configuration file.')
[CompletionResult]::new('--config-dir', 'config-dir', [CompletionResultType]::ParameterName, 'Show bat''s configuration directory.')
diff --git a/assets/completions/bat.bash.in b/assets/completions/bat.bash.in
index e4292a7e..de8651a8 100644
--- a/assets/completions/bat.bash.in
+++ b/assets/completions/bat.bash.in
@@ -78,6 +78,7 @@ _bat() {
--list-themes | \
--line-range | \
-L | --list-languages | \
+ --lessopen | \
--diagnostic | \
--acknowledgements | \
-h | --help | \
@@ -171,6 +172,7 @@ _bat() {
--style
--line-range
--list-languages
+ --lessopen
--diagnostic
--acknowledgements
--help
diff --git a/assets/completions/bat.fish.in b/assets/completions/bat.fish.in
index 54c8413a..b0392dfd 100644
--- a/assets/completions/bat.fish.in
+++ b/assets/completions/bat.fish.in
@@ -163,6 +163,8 @@ complete -c $bat -l italic-text -x -a "$italic_text_opts" -d "When to use italic
complete -c $bat -s l -l language -x -k -a "(__bat_complete_list_languages)" -d "Set the syntax highlighting language" -n __bat_no_excl_args
+complete -c $bat -l lessopen -d "Enable the $LESSOPEN preprocessor" -n __fish_is_first_arg
+
complete -c $bat -s r -l line-range -x -d "Only print lines [M]:[N] (either optional)" -n __bat_no_excl_args
complete -c $bat -l list-languages -f -d "List syntax highlighting languages" -n __fish_is_first_arg
diff --git a/assets/completions/bat.zsh.in b/assets/completions/bat.zsh.in
index 0939c6f2..9acec1f2 100644
--- a/assets/completions/bat.zsh.in
+++ b/assets/completions/bat.zsh.in
@@ -46,7 +46,8 @@ _{{PROJECT_EXECUTABLE}}_main() {
'(: --list-themes --list-languages -L)'{-L,--list-languages}'[Display all supported languages]'
'(: --no-config)'--no-config'[Do not use the configuration file]'
'(: --no-custom-assets)'--no-custom-assets'[Do not load custom assets]'
- '(: --no-lessopen)'--no-lessopen'[Do not use the $LESSOPEN preprocessor]'
+ '(: --lessopen)'--lessopen'[Enable the $LESSOPEN preprocessor]'
+ '(: --no-lessopen)'--no-lessopen'[Disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)]'
'(: --config-dir)'--config-dir'[Show bat'"'"'s configuration directory]'
'(: --config-file)'--config-file'[Show path to the configuration file]'
'(: --generate-config-file)'--generate-config-file'[Generates a default configuration file]'
diff --git a/assets/manual/bat.1.in b/assets/manual/bat.1.in
index 057cfc21..b85520da 100644
--- a/assets/manual/bat.1.in
+++ b/assets/manual/bat.1.in
@@ -248,7 +248,13 @@ These can be installed to `\fB$({{PROJECT_EXECUTABLE}} --config-dir)/themes\fR`,
Much like less(1) does, {{PROJECT_EXECUTABLE}} supports input preprocessors via the LESSOPEN and LESSCLOSE environment variables.
In addition, {{PROJECT_EXECUTABLE}} attempts to be as compatible with less's preprocessor implementation as possible.
-To run {{PROJECT_EXECUTABLE}} without using the preprocessor, call:
+To use the preprocessor, call:
+
+\fB{{PROJECT_EXECUTABLE}} --lessopen\fR
+
+Alternatively, the preprocessor may be enabled by default by adding the '\-\-lessopen' option to the configuration file.
+
+To temporarily disable the preprocessor if it is enabled by default, call:
\fB{{PROJECT_EXECUTABLE}} --no-lessopen\fR