From 44ca1e7df15a514ce9afba5bbc2b103042b369b5 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Jun 2024 20:24:00 +0900 Subject: [PATCH 1/6] Add options present in --help to the man page --- assets/manual/bat.1.in | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/assets/manual/bat.1.in b/assets/manual/bat.1.in index b85520da..6d952814 100644 --- a/assets/manual/bat.1.in +++ b/assets/manual/bat.1.in @@ -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 can be used in addition to control the output width. .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 .IP 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'. Note that the right-hand side is the *name* of the syntax, not a file extension. .HP +\fB\-\-ignored\-suffix\fR +.IP +Ignore extension. For example: 'bat \-\-ignored-suffix ".dev" my_file.json.dev' +will use JSON syntax, and ignore '.dev' +.HP \fB\-\-theme\fR .IP 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 Display a list of supported themes for syntax highlighting. .HP +\fB\-s\fR, \fB\-\-squeeze\-blank\fR +.IP +Squeeze consecutive empty lines into a single empty line. +.HP +\fB\-\-squeeze\-limit\fR +.IP +Set the maximum number of consecutive empty lines to be printed. +.HP \fB\-\-style\fR .IP Configure which elements (line numbers, file headers, grid borders, Git modifications, @@ -184,6 +201,18 @@ Display a list of supported languages for syntax highlighting. This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). The output is always unbuffered \- this option is simply ignored. .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 .IP Print this help message. From 43a77a42f81de49b1bce1525140ef1fdd842f961 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Jun 2024 20:40:56 +0900 Subject: [PATCH 2/6] Add options present in --help to Bash completion --- assets/completions/bat.bash.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/completions/bat.bash.in b/assets/completions/bat.bash.in index de8651a8..3ae993c3 100644 --- a/assets/completions/bat.bash.in +++ b/assets/completions/bat.bash.in @@ -76,6 +76,7 @@ _bat() { -m | --map-syntax | \ --ignored-suffix | \ --list-themes | \ + --squeeze-limit | \ --line-range | \ -L | --list-languages | \ --lessopen | \ @@ -157,6 +158,7 @@ _bat() { --diff-context --tabs --wrap + --chop-long-lines --terminal-width --number --color @@ -169,12 +171,15 @@ _bat() { --ignored-suffix --theme --list-themes + --squeeze-blank + --squeeze-limit --style --line-range --list-languages --lessopen --diagnostic --acknowledgements + --set-terminal-title --help --version --cache-dir From 83a15ac05fd60327984a785375dab8d9e7453883 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 10 Jun 2024 07:48:23 +0900 Subject: [PATCH 3/6] Add --cache-dir to Fish completion --- assets/completions/bat.fish.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/completions/bat.fish.in b/assets/completions/bat.fish.in index d86ebfe6..788f71b0 100644 --- a/assets/completions/bat.fish.in +++ b/assets/completions/bat.fish.in @@ -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 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 config-dir -f -d "Display location of configuration directory" -n __fish_is_first_arg From b1cdc06430a4c99e09d04870cda01a98799917f5 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 10 Jun 2024 07:52:42 +0900 Subject: [PATCH 4/6] Add --no-* options to Bash/Zsh completions --- assets/completions/bat.bash.in | 3 +++ assets/completions/bat.zsh.in | 1 + 2 files changed, 4 insertions(+) diff --git a/assets/completions/bat.bash.in b/assets/completions/bat.bash.in index 3ae993c3..f314bb25 100644 --- a/assets/completions/bat.bash.in +++ b/assets/completions/bat.bash.in @@ -186,6 +186,9 @@ _bat() { --config-dir --config-file --generate-config-file + --no-config + --no-custom-assets + --no-lessopen " -- "$cur")) return 0 fi diff --git a/assets/completions/bat.zsh.in b/assets/completions/bat.zsh.in index 69caceed..7d03abb3 100644 --- a/assets/completions/bat.zsh.in +++ b/assets/completions/bat.zsh.in @@ -48,6 +48,7 @@ _{{PROJECT_EXECUTABLE}}_main() { 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' '(* -)'{-L,--list-languages}'[display all supported languages]' + -P'[disable paging]' "--no-config[don't use the configuration file]" "--no-custom-assets[don't load custom assets]" '(--no-lessopen)'--lessopen'[enable the $LESSOPEN preprocessor]' From d5aa9d8e0512128e6175897ad3f81d580ef9e007 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 10 Jun 2024 08:13:23 +0900 Subject: [PATCH 5/6] Add options generated by completions to the man page --- assets/manual/bat.1.in | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/assets/manual/bat.1.in b/assets/manual/bat.1.in index 6d952814..2bc0a3a5 100644 --- a/assets/manual/bat.1.in +++ b/assets/manual/bat.1.in @@ -201,6 +201,18 @@ Display a list of supported languages for syntax highlighting. This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). The output is always unbuffered \- this option is simply ignored. .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. @@ -241,6 +253,20 @@ location of the configuration file. To generate a default configuration file, call: \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" {{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 @@ -287,6 +313,16 @@ To temporarily disable the preprocessor if it is enabled by default, call: \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). .SH "MORE INFORMATION" From 9a650e827915c7e310e73ffe1822247a5bda7064 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Jun 2024 21:16:31 +0900 Subject: [PATCH 6/6] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa4c8de0..610af60a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ - Update the Lisp syntax, see #2970 (@ccqpein) - Use bat's ANSI iterator during tab expansion, see #2998 (@eth-p) - 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