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

Implement key functionality of jq #6

Open
cryptaliagy opened this issue Jul 1, 2024 · 4 comments
Open

Implement key functionality of jq #6

cryptaliagy opened this issue Jul 1, 2024 · 4 comments

Comments

@cryptaliagy
Copy link
Owner

cryptaliagy commented Jul 1, 2024

from https://github.com/gl-yziquel

@gl-yziquel

Hi.

Been using tomlq to parse various build related stuff on my machine. For instance, in executable Justfiles, or for autotools scaffolding, like that:

https://github.com/gl-yziquel/skeleton-autotools/blob/master/configure.ac#L4

One feature I'd like, in order to have nice output surrounding the output of just --list would be to be able to list the features of a cargo rust project. And present them nicely. I would therefore love if the keys functionalities of jq were implemented with tq.

@gl-yziquel
Copy link

gl-yziquel commented Jul 1, 2024

@cryptaliagy

I've switched internally to using the tomlq tool of the python yq package. I have all the functionality I need. But the performance hit is very significant compared to tq.

https://github.com/cmeister2/tomlq.git

@cryptaliagy
Copy link
Owner Author

@gl-yziquel I've started taking a look at what would be involved. I can't promise I'll have this feature in the very near-term future, but I'll see if I can start implementing a very basic grammar with minimal function support (just keys and the existing functionality at this point) before year end

@gl-yziquel
Copy link

@gl-yziquel I've started taking a look at what would be involved. I can't promise I'll have this feature in the very near-term future, but I'll see if I can start implementing a very basic grammar with minimal function support (just keys and the existing functionality at this point) before year end

I'm not expecting anything. I know people are busy. I just raised the issue because I noticed it.

@cryptaliagy
Copy link
Owner Author

Very fair, and thank you for the suggested functionality!

I've added #10 which might help your usecase while not resolving this issue in particular. This will add support for you to export values from tomlq as JSON, which you can chain with jq for a (hopefully) more efficient setup.

tq -f Cargo.toml features -o json | jq keys

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