jaq icon indicating copy to clipboard operation
jaq copied to clipboard

Add `?//` (Destructuring Alternative Operator) support

Open A4-Tacks opened this issue 9 months ago • 1 comments

$ jq  -n '{x:1} as [$x] ?// {$x} | $x'
1
$ jaq -n '{x:1} as [$x] ?// {$x} | $x'
Error: expected |
  ╭─[<inline>]
  │
1 │ {x:1} as [$x] ?// {$x} | $x
  ┆               ┬            
  ┆               │            
  ┆               ╰───────────── unexpected token
──╯

A4-Tacks avatar Mar 26 '25 13:03 A4-Tacks

Yes, adding this would be nice, but it's probably quite hard and not really on my roadmap.

01mf02 avatar Mar 27 '25 11:03 01mf02