ouch icon indicating copy to clipboard operation
ouch copied to clipboard

Add `list-formats` subcommand to show support-status of each format, with optional JSON output

Open bew opened this issue 1 year ago • 3 comments

Hello!

I'd like to have a way to introspect ouch and what it currently supports. And with an optional --json to be able to write some wrapper scripts that can act based on format support.

What do you think about this?

bew avatar Dec 03 '23 03:12 bew

Did you find a use case for the --json part?

Could be useful for people who are writing scripts to benchmark all formats and/or the combination of them to see if they produce any valuable results.

But I wonder if it wouldn't be easier to just copy the output of such a command, instead of parsing the JSON output.

marcospb19 avatar Dec 05 '23 16:12 marcospb19

Yeah actually no strong feeling about this, I got hyped by nushell and how everything is structured but I don't have clear use case

bew avatar Dec 06 '23 08:12 bew

It would be particularly useful for a subcommand like this to output MIME types. It would also be preferable that running this subcommand would be extremely quick (which I imagine would be possible by pre-compiling the list of supported formats).

My use case is that I have a preview script that I use for a TUI file manager, and within that script I need to determine which program to call in order to preview a file (which I currently do by matching on the file's MIME type). ouch's list subcommand is perfect for previewing archives, but without some way to query which file types ouch supports, I can't reliably use it to preview.

jaminthorns avatar Dec 19 '23 21:12 jaminthorns