Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cmd completion #113

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

blaggacao
Copy link
Contributor

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

/// The flake to deploy
#[clap(group = "deploy")]
#[clap(group = "deploy", value_hint = ValueHint::DirPath)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, prospectively a dynamic value hint would be useful.

@notgne2
Copy link
Contributor

notgne2 commented Aug 11, 2021

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.

@blaggacao
Copy link
Contributor Author

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 blaggacao marked this pull request as draft August 11, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants