cli icon indicating copy to clipboard operation
cli copied to clipboard

Make `-f`/`--field` auto-completion work for `<ip>` and `<asn>` subcommands

Open UmanShahzad opened this issue 4 years ago • 2 comments

Those flags currently properly auto-complete for e.g. myip, bulk, etc., but we currently aren't able to easily specify that completion must occur for the raw IP / ASN subcommands.

Find a way to make this work and implement that.

UmanShahzad avatar Jun 04 '21 00:06 UmanShahzad

Have you looked into spf13/cobra? It's more or less, an extension of the spf13/pflags package you're already using and gives you things like auto-completion for free. Things like the help texts are also easier to maintain because it's largely auto-generated.

I'd consider submitting a pr to move to cobra if there is interest.

cc: @UmanShahzad @coderholic

nicksherron avatar Jul 09 '22 04:07 nicksherron

Shifting to any CLI framework at this point would be a ginormous refactor. But we consider the framework you linked a while back but had used a different framework, and then had to undo that since it was too limiting and made it complex to support more sophisticated use cases like a pseudo-subcommand of <ip> and <asn> or other custom behavior. I think we'd only consider a framework if it's offering something really big & special that we can't trivially do on our own at this point. This auto-completion case alone doesn't warrant that I'd say.

UmanShahzad avatar Jul 09 '22 12:07 UmanShahzad