Describe the bug you encountered:
I am attempting to distribute a custom bat theme with my tool to use. I want to avoid the possibility of messing with the user's installed bat themes and theme cache.
Notably, the bat cache --build --blank command does not work when the destination path already exists, and it throws an unusual error message.
Note that it works the first time:
$ mkdir -p /tmp/bat-cache-bug
$ cd /tmp/bat-cache-bug
$ XDG_CONFIG_HOME=$PWD BAT_CACHE_PATH=$PWD/cache bat cache --build
No themes were found in '/tmp/bat-cache-bug/bat/themes', using the default set
No syntaxes were found in '/tmp/bat-cache-bug/bat/syntaxes', using the default set.
Writing theme set to /tmp/bat-cache-bug/cache/themes.bin ... okay
Writing syntax set to /tmp/bat-cache-bug/cache/syntaxes.bin ... okay
Writing metadata to folder /tmp/bat-cache-bug/cache ... okay
But fails the second time, with the exact same command:
$ XDG_CONFIG_HOME=$PWD BAT_CACHE_PATH=$PWD/cache bat cache --build
error: Found argument '--build' which wasn't expected, or isn't valid in this context
USAGE:
bat [OPTIONS] [FILE]...
bat <SUBCOMMAND>
For more information try --help
What did you expect to happen instead?
Rebuilding the cache would also be nice, as that's the expected behavior.
A better error message would be helpful.
How did you install bat?
brew install bat
bat version and environment
$ XDG_CONFIG_HOME=$PWD BAT_CACHE_PATH=$PWD/cache bat --diagnostic
Software version
bat 0.18.1 ()
Operating system
macOS 12.0 (Darwin 21.0.0)
Command-line
Environment variables
SHELL=/bin/zsh
PAGER=less
LESS='-F -i -M -R -S -w -X -z-4'
BAT_PAGER=<not set>
BAT_CACHE_PATH=/tmp/bat-cache-bug/cache
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_STYLE=plain
BAT_TABS=<not set>
BAT_THEME=<not set>
XDG_CONFIG_HOME=/tmp/bat-cache-bug
XDG_CACHE_HOME=<not set>
COLORTERM=truecolor
NO_COLOR=<not set>
MANPAGER='sh -c '\''col -bx | bat -l man -p'\'''
Config file
Could not read contents of '/tmp/bat-cache-bug/bat/config': No such file or directory (os error 2).
Compile time information
- Profile: release
- Target triple: x86_64-apple-darwin
- Family: unix
- OS: macos
- Architecture: x86_64
- Pointer width: 64
- Endian: little
- CPU features: fxsr,sse,sse2,sse3,ssse3
- Host: x86_64-apple-darwin
Less version
> less --version
less 487 (POSIX regular expressions)
Copyright (C) 1984-2016 Mark Nudelman
less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Homepage: http://www.greenwoodsoftware.com/less
Describe the bug you encountered:
I am attempting to distribute a custom
battheme with my tool to use. I want to avoid the possibility of messing with the user's installedbatthemes and theme cache.Notably, the
bat cache --build --blankcommand does not work when the destination path already exists, and it throws an unusual error message.Note that it works the first time:
But fails the second time, with the exact same command:
What did you expect to happen instead?
Rebuilding the cache would also be nice, as that's the expected behavior.
A better error message would be helpful.
How did you install
bat?brew install batbat version and environment
Software version
bat 0.18.1 ()
Operating system
macOS 12.0 (Darwin 21.0.0)
Command-line
Environment variables
Config file
Could not read contents of '/tmp/bat-cache-bug/bat/config': No such file or directory (os error 2).
Compile time information
Less version