-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Compatibility with POSIX cat for files named "cache" #245
Comments
Thank you for your feedback!
You are absolutely right. I thought about it, but haven't opened a ticket.
I don't think we plan on adding more subcommands at the moment.
|
I would like to work on this one if no one else is working on it! |
Just a heads up, I am still working on it, I should be able to submit the PR in a day or two! |
Now if a cache file exists in the current directory, and the use passes no arguments to the cache command, the cache file would be displayed. If however the user uses cache command with arguments, the cache command would be executed as normal regardless of wether the file cache exists in the current directory or not.
First, thanks for this very useful utility. This is not really a bug at this point since it appears to be a design choice (#82), but thought it would be nice to get clarification on this.
bat
treats files namedcache
(and previously,init-cache
) as a subcommand and fails when it's the first argument. Granted this only happens when the file appears first AND is in the current directory, so probably not a big deal. But it does mean this just misses being a drop-in replacement forcat
(esp. in non-interactive scenarios) and potentially breaks POSIX compliance (only-
is a special filename). I see there's also talk on adding more subcommands on #23 which would depart further from compatibility.In following on the project goals, is there any good way around this? Perhaps by using
--cache-X
or other approach.Edit: Linking to POSIX compliance issue – #134
The text was updated successfully, but these errors were encountered: