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

list without json format #35

Open
sjomae opened this issue Jun 3, 2023 · 8 comments
Open

list without json format #35

sjomae opened this issue Jun 3, 2023 · 8 comments

Comments

@sjomae
Copy link

sjomae commented Jun 3, 2023

Comparing with lv2ls, lv2ls gives just a list of LV2 plugins/urls, while clap-info -l dumps it to stdout in json format. I think the lv2ls is useful on Unix systems, while it's easier to pipe with Unix tools like grep and such.

Clap-info could provide both ways probably.

@baconpaul
Copy link
Collaborator

Why not just use jq?

paul ~/dev/music/clap-projects/clap-info (upgrade-118) % ./cmake-build-debug/clap-info -l | jq -r '.result[]'
/Users/paul/Library/Audio/Plug-Ins/CLAP/Stochas.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/Dexed.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/Diopser.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/Surge XT.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/Surge XT Effects.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/Odin2.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/PaulXStretch.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/tuning-workbench-synth.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/Shortcircuit XT.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/tuning-note-claps.clap
/Users/paul/Library/Audio/Plug-Ins/CLAP/LauridsenSchodderStereo.clap

@sjomae
Copy link
Author

sjomae commented Jun 3, 2023

That's a option, but do you think that's a convenient option? I think clap-info should provide it.

@baconpaul
Copy link
Collaborator

well. yes. the idea we had with clap-info was to produce a variety of structured data you could read with tools!

If you want to add a --list-raw option I guess i would merge it, but really as you know the unix philosophy is to pipe together programs to do transforms, and jq is a great example of that.

./cmake-build-debug/clap-info -s | jq '.result[].plugins[].id' 

for instance extracts all the ids from a scan

I don't think we want to add 100 options to take all the permutations of data when we can just output the data and use a widely available tool to parse it.

@baconpaul
Copy link
Collaborator

oooh neat like here's another fun one

paul ~/dev/music/clap-projects/clap-info (upgrade-118) % ./cmake-build-debug/clap-info -s | jq '.result[]."clap-version"'  | sort | uniq
"0.21.0"
"1.0.0"
"1.0.2"
"1.1.1"
"1.1.8"

@sjomae
Copy link
Author

sjomae commented Jun 3, 2023

Who says 100 options? This is a request for one default/ reasonable option.

@baconpaul
Copy link
Collaborator

yeah so i get what your request is. For one and only one case don't output json so you don't have to pipe and if anyone asks for any other case to do the same, say no, and tell them to use jq.

Like I said if you want to add --list-raw i'd merge it I guess. but the tool is really meant to be used in conjunction with a pipeline which can read json.

@baconpaul
Copy link
Collaborator

Anyway if you want to do that then

if (showClaps)

that's where we make the list json. Add another option above for list raw, copy that branch to instead of appending to doc, dump to stdout, and then suppress the output of the document on return using the mechanism in the error paths elsewhere

@baconpaul
Copy link
Collaborator

oh finally, clap-info is written so the scanner is a separate library from the executable itself, so you can use the C++ software to write other scan and inspect tools of your choosing!

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

No branches or pull requests

2 participants