wader / fq

jq for binary formats - tool, language and decoders for working with binary and text formats

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature] shell completions

Freed-Wu opened this issue · comments

Hey, yes that would be nice. Unfortunately fq does not use cobra or any common go argument parser package. This is because most of the CLI and glue code in fq is implemented with jq code, it makes many things smoother to implement but also some things harder :)

But i think it shouldn't be that much work to provide at least basic completion support via --completion argument etc. All arguments are defined here https://github.com/wader/fq/blob/master/pkg/interp/options.jq#L383-L523 and to support completing decode names etc i guess one could generate calls to fq with small snippets? maybe could extend _opt_cli_opts to include optional jq snippet to get possible values?

Let me know if it's something you would like to work on. Maybe i could spend some time adding support for one shell and then adding others would be easier?

commented

Sorry, I am not familiar with golang 😢

No worries :) think i will try to do a quick stab at it. It will probably involve mostly writing jq code. Can let you know if/when i have something.