8000 `--style` documentation is misleading · Issue #3316 · sharkdp/bat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

--style documentation is misleading #3316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TheBicPen opened this issue May 30, 2025 · 0 comments
Open

--style documentation is misleading #3316

TheBicPen opened this issue May 30, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@TheBicPen
Copy link

The description on --style is misleading. It says "auto: same as 'full', unless the output is piped." and "full: enables all available components (default)".

This is misleading - I read it as saying that when --style=full is passed, the full decorations are enabled in a command like this: echo '' | bat --style=full | cat. This is not the case - this pipeline prints a newline rather than something like "STDIN\n 1 ". Compare the output with echo '' | bat --style=full. If the output is piped, loop_through is enabled, the SimplePrinter is selected, and the output is printed without any decorations regardless of the --style=full flag. This effectively throws away the style configuration whenever cat-compatibility mode is enabled, which is not what the documentation says.

As a secondary question, what is the point of the --style=auto option if the style is ignored when the output is piped? It provides the same functionality as --style=full --decorations=auto. It seems like having both is redundant.

@TheBicPen TheBicPen added the bug Something isn't working label May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant
0