~gpanders/ijq#4: 
Filter not working with names that contain dashes

I am trying to filter the output of nix show-config. Some of the attributes contain dashes like experimental-features. To make them work with jq they need to be quoted. For example the following would be valid: nix show-config --json | jq '."experimental-features". ijq does not add the quotes in the filter which makes the preview and the final command fail. jq probably wants to substract something according to the error message: jq: error: features/0 is not defined at <top-level>, line 1:.

Status
RESOLVED FIXED
Submitter
~sandro
Assigned to
No-one
Submitted
2 months ago
Updated
2 months ago
Labels
No labels applied.

~gpanders 2 months ago

ijq passes the filter you enter directly to jq without any modifications, so you need to put the quotes in ijq as well.

The quotes are not included in the auto-completion entries though, and maybe that is what you're referring to. I can look into automatically adding quotes around keys that need to be escaped in the autocomplete list.

~gpanders REPORTED FIXED 2 months ago

v0.3.6 now automatically uses quotes around keys containing special characters.

Register here or Log in to comment, or comment via email.