-
Notifications
You must be signed in to change notification settings - Fork 227
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
Feature request: zero-length start/end properties #708
Comments
Hi, i think you can already do it if i don't misunderstand what you want to do: $ fq '.frames[1] | tobytes, tobytesrange, tobits, tobitsrange | {start,stop,size}' doc/file.mp3
{
"size": 208,
"start": 0,
"stop": 208
}
{
"size": 208,
"start": 2937,
"stop": 3145
}
{
"size": 1664,
"start": 0,
"stop": 1664
}
{
"size": 1664,
"start": 23496,
"stop": 25160
} So binaries has start/stop/size properties but you have to use Hope that helps and let me know if it make sense :) |
Maybe the discussion in #639 is interesting also |
Yeah, I left a comment there recently. The question is why use an extra step? Why not just |
Ah sorry noticed your comment now. It's possible using
So the current "safe" solution is that you have to use a function. But i'm open to change this if we can come up with something that don't mess too much with how one would expect jq to behave. Some new syntax could be interesting, ideally compatible with jq, but would require maintain larger change to gojq etc. |
Close for now? maybe revisit in the future if some fancier syntax for "special" properties are introduces? |
Yes, closing. Underscore-prefixed items are great, somehow missed them. I guess they will stay unless something else is introduced. |
@ksa-real 👍 yeap think they will stay for now |
Allow access of start/end position of byte range-like structures via start / end read-only properties.
The properties are already present internally, so it looks like it won't break anything. Please let me know if I'm wrong.
The text was updated successfully, but these errors were encountered: