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

feat(iota): Add shell completions #4608

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

DaughterOfMars
Copy link
Contributor

Description of change

Adds the ability to generate shell completion files using clap_completion to the CLI. These files are also included in these changes. Let me know if you think these should be checked in, or whether users should be required to generate them themselves. Of course, if they are checked it they must be updated whenever the CLI changes. This could be checked in CI.

Links to any relevant issues

Closes #4495

@DaughterOfMars DaughterOfMars requested a review from a team as a code owner December 23, 2024 16:09
@iota-ci iota-ci added dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group. labels Dec 23, 2024
Copy link
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

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

I would either put all this under a non-default feature or remove the checked-in completions.
If we publish them, then the command is not very useful for the masses and it's adding dependencies for not much.

@alexsporn
Copy link
Member

I would put this behind a feature flag and only use that feature when we release binaries to generate the completions.
The completions then should be added to both the binaries release and the brew formula.
Wdyt?

@DaughterOfMars
Copy link
Contributor Author

I would put this behind a feature flag and only use that feature when we release binaries to generate the completions. The completions then should be added to both the binaries release and the brew formula. Wdyt?

I think that's reasonable.

oop

Co-authored-by: Thibault Martinez <[email protected]>
@@ -363,6 +363,8 @@ pub enum IotaCommand {
/// Invoke Iota's move-analyzer via CLI
#[clap(name = "analyzer", hide = true)]
Analyzer,
#[cfg(feature = "gen-completions")]
GenerateCompletions(crate::completions::CompletionCommand),
Copy link
Member

Choose a reason for hiding this comment

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

kinda bothers me that the command variant doesn't match the command type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If anyone else wants to change this, vote here 😆 It doesn't bother me, personally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-Completion for IOTA CLI
4 participants