-
-
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
Extra file information in the header #1701
Comments
Thank you for this feature request. I would also like to see this being integrated into As for the details on how this could work, it would be great to discuss this here in detail before anyone attempts to implement this. I think I like the |
Hello 👋 I'm interested in working on this. I think we can start by having a basic list of information that can be toggled on/off using I can propose we start with implementing these basics, and later on we can extend it to include more if necessary:
More information to add later:
I don't think it needs to be multi-line necessarily. I'm drawing inspiration mostly from
Or a one-liner:
|
Personally I find the multiple lines much clearer. |
@mdibaiee I took a high level look at your PR and it was a good start 👍 My main high level concern is if we really want to introduce a new option type (
I would like to propose that we change this (in a compatible way) to something like this:
I think that has the potential of simplifying both the code and the CLI quite a bit. If you think it sounds like a good idea, it would be great with a quick and dirty prototype to get a sense for what the code would look like with such an approach. |
@Enselic I like the idea, I don't think much will change in the code, but it will be simplified to some extend 👍 |
@Enselic Just a note: I had to slightly deviate from code of Style when implementing header information, because in the current |
Sometimes, you want to quickly glance at more information, in the header, than just the file name, e.g.: mime type, or file size, or relevant timestamps/dates, or full path, or permissions, etc.
I've managed to somewhat accomplish this with just the
--file-name
option, but (A) I don't feel it's really appropriate, and (B) syntax detection fails, so you don't get any highlighting which sucks, and (C) the grid lines aren't printed:So yeah I thought this might be an interesting feature, that perhaps others might find useful as well. Also this would make the
fzf
&bat
integration really quite nice and even more useful.To be a bit more precise on the actual feature, without getting into implementation: a feature that allows inserting a variety of other useful information on the file, in the header. Either you could provide us with a list of possible additional informations, kinda like
--style
's possible values, and we list them out in an option, e.g.:AND-additionally/OR provide the ability to specify arbitrary scripts that produce some text output, or some formatted (e.g. JSON, XML, HTML, or your custom designed format) output, something that you can easily read and print in the header; also you could limit the output to 1 line, or maybe not, I don't know. This could be kind of like
fzf
's--bind '...:execute(<script>)'
option, where the user provides a script, i.e some chain of commands and not a script file, of what they want. E.g.:{}
being a placeholder for the file.The output would be printed in the header, 1 line under the other, in the order specified.
Also, Thank you for your wonderful work with
bat
and all the other command line tools you've created, they're really useful !The text was updated successfully, but these errors were encountered: