Merge pull request #2995 from akinomyoga/update-man

Update the man page of bat (`assets/manual/bat.1.in`)
This commit is contained in:
Keith Hall 2024-07-29 07:14:31 +03:00 committed by GitHub
commit fd1e0d5876
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 77 additions and 0 deletions

View File

@ -42,6 +42,7 @@
- Update the Lisp syntax, see #2970 (@ccqpein) - Update the Lisp syntax, see #2970 (@ccqpein)
- Use bat's ANSI iterator during tab expansion, see #2998 (@eth-p) - Use bat's ANSI iterator during tab expansion, see #2998 (@eth-p)
- Support 'statically linked binary' for aarch64 in 'Release' page, see #2992 (@tzq0301) - Support 'statically linked binary' for aarch64 in 'Release' page, see #2992 (@tzq0301)
- Update options in shell completions and the man page of `bat`, see #2995 (@akinomyoga)
## Syntaxes ## Syntaxes

View File

@ -76,6 +76,7 @@ _bat() {
-m | --map-syntax | \ -m | --map-syntax | \
--ignored-suffix | \ --ignored-suffix | \
--list-themes | \ --list-themes | \
--squeeze-limit | \
--line-range | \ --line-range | \
-L | --list-languages | \ -L | --list-languages | \
--lessopen | \ --lessopen | \
@ -157,6 +158,7 @@ _bat() {
--diff-context --diff-context
--tabs --tabs
--wrap --wrap
--chop-long-lines
--terminal-width --terminal-width
--number --number
--color --color
@ -169,18 +171,24 @@ _bat() {
--ignored-suffix --ignored-suffix
--theme --theme
--list-themes --list-themes
--squeeze-blank
--squeeze-limit
--style --style
--line-range --line-range
--list-languages --list-languages
--lessopen --lessopen
--diagnostic --diagnostic
--acknowledgements --acknowledgements
--set-terminal-title
--help --help
--version --version
--cache-dir --cache-dir
--config-dir --config-dir
--config-file --config-file
--generate-config-file --generate-config-file
--no-config
--no-custom-assets
--no-lessopen
" -- "$cur")) " -- "$cur"))
return 0 return 0
fi fi

View File

@ -133,6 +133,8 @@ set -l tabs_opts '
complete -c $bat -l acknowledgements -d "Print acknowledgements" -n __fish_is_first_arg complete -c $bat -l acknowledgements -d "Print acknowledgements" -n __fish_is_first_arg
complete -c $bat -l cache-dir -f -d "Show bat's cache directory" -n __fish_is_first_arg
complete -c $bat -l color -x -a "$color_opts" -d "When to use colored output" -n __bat_no_excl_args complete -c $bat -l color -x -a "$color_opts" -d "When to use colored output" -n __bat_no_excl_args
complete -c $bat -l config-dir -f -d "Display location of configuration directory" -n __fish_is_first_arg complete -c $bat -l config-dir -f -d "Display location of configuration directory" -n __fish_is_first_arg

View File

@ -48,6 +48,7 @@ _{{PROJECT_EXECUTABLE}}_main() {
default auto full plain changes header header-filename header-filesize grid rule numbers snip' default auto full plain changes header header-filename header-filesize grid rule numbers snip'
\*{-r+,--line-range=}'[only print the specified line range]:start\:end' \*{-r+,--line-range=}'[only print the specified line range]:start\:end'
'(* -)'{-L,--list-languages}'[display all supported languages]' '(* -)'{-L,--list-languages}'[display all supported languages]'
-P'[disable paging]'
"--no-config[don't use the configuration file]" "--no-config[don't use the configuration file]"
"--no-custom-assets[don't load custom assets]" "--no-custom-assets[don't load custom assets]"
'(--no-lessopen)'--lessopen'[enable the $LESSOPEN preprocessor]' '(--no-lessopen)'--lessopen'[enable the $LESSOPEN preprocessor]'

View File

@ -87,6 +87,10 @@ Set the tab width to T spaces. Use a width of 0 to pass tabs through directly
Specify the text\-wrapping mode (*auto*, never, character). The '\-\-terminal\-width' option Specify the text\-wrapping mode (*auto*, never, character). The '\-\-terminal\-width' option
can be used in addition to control the output width. can be used in addition to control the output width.
.HP .HP
\fB\-S\fR, \fB\-\-chop\-long\-lines\fR
.IP
Truncate all lines longer than screen width. Alias for '\-\-wrap=never'.
.HP
\fB\-\-terminal\-width\fR <width> \fB\-\-terminal\-width\fR <width>
.IP .IP
Explicitly set the width of the terminal instead of determining it automatically. If Explicitly set the width of the terminal instead of determining it automatically. If
@ -141,6 +145,11 @@ use -m '*.build:Python'. To highlight files named '.myignore' with the Git Ignor
syntax, use -m '.myignore:Git Ignore'. syntax, use -m '.myignore:Git Ignore'.
Note that the right-hand side is the *name* of the syntax, not a file extension. Note that the right-hand side is the *name* of the syntax, not a file extension.
.HP .HP
\fB\-\-ignored\-suffix\fR <ignored-suffix>
.IP
Ignore extension. For example: 'bat \-\-ignored-suffix ".dev" my_file.json.dev'
will use JSON syntax, and ignore '.dev'
.HP
\fB\-\-theme\fR <theme> \fB\-\-theme\fR <theme>
.IP .IP
Set the theme for syntax highlighting. Use '\-\-list\-themes' to see all available themes. Set the theme for syntax highlighting. Use '\-\-list\-themes' to see all available themes.
@ -151,6 +160,14 @@ export the BAT_THEME environment variable (e.g.: export BAT_THEME="...").
.IP .IP
Display a list of supported themes for syntax highlighting. Display a list of supported themes for syntax highlighting.
.HP .HP
\fB\-s\fR, \fB\-\-squeeze\-blank\fR
.IP
Squeeze consecutive empty lines into a single empty line.
.HP
\fB\-\-squeeze\-limit\fR <squeeze-limit>
.IP
Set the maximum number of consecutive empty lines to be printed.
.HP
\fB\-\-style\fR <style\-components> \fB\-\-style\fR <style\-components>
.IP .IP
Configure which elements (line numbers, file headers, grid borders, Git modifications, Configure which elements (line numbers, file headers, grid borders, Git modifications,
@ -184,6 +201,30 @@ Display a list of supported languages for syntax highlighting.
This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). The output is This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). The output is
always unbuffered \- this option is simply ignored. always unbuffered \- this option is simply ignored.
.HP .HP
\fB\-\-no\-custom\-assets\fR
.IP
Do not load custom assets.
.HP
\fB\-\-config\-dir\fR
.IP
Show bat's configuration directory.
.HP
\fB\-\-cache\-dir\fR
.IP
Show bat's cache directory.
.HP
\fB\-\-diagnostic\fR
.IP
Show diagnostic information for bug reports.
.HP
\fB\-\-acknowledgements\fR
.IP
Show acknowledgements.
.HP
\fB\-\-set\-terminal\-title\fR
.IP
Sets terminal title to filenames when using a pager.
.HP
\fB\-h\fR, \fB\-\-help\fR \fB\-h\fR, \fB\-\-help\fR
.IP .IP
Print this help message. Print this help message.
@ -212,6 +253,20 @@ location of the configuration file.
To generate a default configuration file, call: To generate a default configuration file, call:
\fB{{PROJECT_EXECUTABLE}} --generate-config-file\fR \fB{{PROJECT_EXECUTABLE}} --generate-config-file\fR
These are related options:
.HP
\fB\-\-config\-file\fR
.IP
Show path to the configuration file.
.HP
\fB\-\-generate-config\-file\fR
.IP
Generates a default configuration file.
.HP
\fB\-\-no\-config\fR
.IP
Do not use the configuration file.
.SH "ADDING CUSTOM LANGUAGES" .SH "ADDING CUSTOM LANGUAGES"
{{PROJECT_EXECUTABLE}} supports Sublime Text \fB.sublime-syntax\fR language files, and can be {{PROJECT_EXECUTABLE}} supports Sublime Text \fB.sublime-syntax\fR language files, and can be
customized to add additional languages to your local installation. To do this, add the \fB.sublime-syntax\fR language customized to add additional languages to your local installation. To do this, add the \fB.sublime-syntax\fR language
@ -258,6 +313,16 @@ To temporarily disable the preprocessor if it is enabled by default, call:
\fB{{PROJECT_EXECUTABLE}} --no-lessopen\fR \fB{{PROJECT_EXECUTABLE}} --no-lessopen\fR
These are related options:
.HP
\fB\-\-lessopen\fR
.IP
Enable the $LESSOPEN preprocessor.
.HP
\fB\-\-no\-lessopen\fR
.IP
Disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)
.PP
For more information, see the "INPUT PREPROCESSOR" section of less(1). For more information, see the "INPUT PREPROCESSOR" section of less(1).
.SH "MORE INFORMATION" .SH "MORE INFORMATION"