deploy-rs icon indicating copy to clipboard operation
deploy-rs copied to clipboard

add cmd completion

Open blaggacao opened this issue 4 years ago • 2 comments

  • Add default flake and node from environment values
  • Add initial completions support

blaggacao avatar Aug 06 '21 16:08 blaggacao

I would like to have this, but this implementation looks excessively verbose. If this is something difficult to do with clap I don't mind switching to another argument parser if there is one that can handle this better (in fact, there is other issues I have with it too), and if not maybe we can try to help clap get native completion support, or at least offload more of the boilerplate-esque code.

I've also never even heard of clap_generate before, so explaining more of what is being done in this PR would be appreciated at least for documentation sake.

notgne2 avatar Aug 11 '21 04:08 notgne2

The main issue that I currently see with clap is its lack for dynamic completion support. On the other hand, it is my (first) impression, that clap seems to be the most advanced and feature complete lib in the rust ecosystem.

clap_generate effectively (only) holds the code for the generation of each shell's command completion scripts.

I still have to think about what we could usefully do with this PR. While simple command completion is nice, the real power would come from dynamic command completion that is capable of suggesting nodes and profiles for any given target flake.

blaggacao avatar Aug 11 '21 14:08 blaggacao