Skip to content

--style documentation is misleading #3316

@TheBicPen

Description

@TheBicPen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions