Skip to content

Bat is broken for filenames that are prefixes of "cache" #557

@mk12

Description

@mk12

The issue with files named "cache" was already identified in #245 and fixed in #275. However, the clap parser doesn't require an exact match: any prefix of the subcommand "cache" will do. So if you try bat c (or "ca", "cac", "cach"), one of the following will happen:

  1. If there is a file named "cache", it will print that instead (the wrong file!).
  2. Otherwise, it will print an error message about --build/--clear being required.

I think it's best to avoid subcommands and use something like --cache instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions