Skip to content
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

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

Open
bew opened this issue Dec 3, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@bew
Copy link

bew commented Dec 3, 2023

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 bew added the enhancement New feature or request label Dec 3, 2023
@marcospb19
Copy link
Member

marcospb19 commented Dec 5, 2023

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.

@bew
Copy link
Author

bew commented Dec 6, 2023

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

@jaminthorns
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants