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

interp: Change default bits_format=string #499

Merged
merged 1 commit into from Dec 1, 2022
Merged

Conversation

wader
Copy link
Owner

@wader wader commented Dec 1, 2022

I think this is more intuitive but might in some case cause very large JSON output but maybe that less common or expected. In does cases i think you either want to use some other bits_format (md5, truncate, etc) or you delete/transform the jq value before turn it into JSON.

Strings in gojq are binary safe so you can use to hold raw bytes. But note that convert the binary into JSON is lossy, same as the JSON standard.

Add bits_format option documentation.

@wader
Copy link
Owner Author

wader commented Dec 1, 2022

@dgmcdona This should make it easier to further transform decode fields like for bplist/apple_bookmark

I think this is more intuitive but might in some case cause very large JSON output
but maybe that less common or expected. In does cases i think you either want to
use some other bits_format (md5, truncate, etc) or you delete/transform the jq value
before turn it into JSON.

Strings in gojq are binary safe so you can use to hold raw bytes. But note that
convert the binary into JSON is lossy, same as the JSON standard.

Add bits_format option documentation.
@wader wader merged commit 012e752 into master Dec 1, 2022
@wader wader deleted the bit-format-default-string branch December 1, 2022 17:08
@dgmcdona
Copy link
Contributor

dgmcdona commented Dec 1, 2022

What do you think about some sort of .fq.conf file so users can set options to match their own common cases without having to specify each time?

@wader
Copy link
Owner Author

wader commented Dec 1, 2022

What do you think about some sort of .fq.conf file so users can set options to match their own common cases without having to specify each time?

Yeah that is good idea, have a couple of way of the top of my head:

  • Something in the already existing init.jq file, but it would have to be some kind of jq syntax, maybe not easy to use.
  • Environment variable with options FQ_OPTIONS etc with raw -o ... args? or name=value,name=value... or name=value name=value
  • A separate file like fq.conf somehow
  • More?

In either case i think command line argument should override, so order would defaults,user,cli-args,repl-options,function-options (to d etc)?

btw if you want to see all options with current value you can do fq -n options, some of them are a bit internal.

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

Successfully merging this pull request may close these issues.

None yet

2 participants