1
1
mirror of https://github.com/wader/fq.git synced 2024-12-26 15:02:28 +03:00
fq/pkg/interp/formats.jq
2021-09-21 16:42:35 +02:00

17 lines
432 B
Plaintext

# note this is a "dynamic" include, outputted string will be used as source
( [ ( _registry.groups
| to_entries[]
# TODO: nicer way to skip "all" which also would override builtin all/*
| select(.key != "all")
| "def \(.key)($opts): _decode(\(.key | tojson); $opts);"
, "def \(.key): _decode(\(.key | tojson); {});"
)
, ( _registry.formats[]
| select(.files)
| .files[]
)
]
| join("\n")
)