ouch
ouch copied to clipboard
Add `list-formats` subcommand to show support-status of each format, with optional JSON output
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?
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.
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
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.