-
Notifications
You must be signed in to change notification settings - Fork 2
EIM-211: added the auto_clap functionality to generate completion scripts #220
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @alirana01, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the command-line interface by adding the capability to generate shell completion scripts. This feature significantly improves user experience by providing auto-completion for Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new completions
command to generate shell completion scripts, leveraging the clap_complete
crate. The implementation is straightforward and correct. My review includes a couple of suggestions to improve dependency management by making clap_complete
an optional dependency tied to the cli
feature, and a minor code cleanup to remove a redundant variable shadowing. Overall, this is a great addition to the CLI's usability.
src-tauri/Cargo.toml
Outdated
cli = [ | ||
"dep:clap", | ||
"dep:dialoguer", | ||
"dep:indicatif", | ||
"dep:console", | ||
"dep:log4rs", | ||
"vendored-openssl", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clap_complete
dependency is used for the Completions
CLI command, so it should be part of the cli
feature to ensure it's only included in CLI builds. This will prevent it from being included in builds that don't have the cli
feature enabled.
To fix this, you should also mark clap_complete
as optional in the [dependencies]
section (line 153) like this:
clap_complete = { version = "4.5.58", optional = true }
cli = [ | |
"dep:clap", | |
"dep:dialoguer", | |
"dep:indicatif", | |
"dep:console", | |
"dep:log4rs", | |
"vendored-openssl", | |
] | |
cli = [ | |
"dep:clap", | |
"dep:clap_complete", | |
"dep:dialoguer", | |
"dep:indicatif", | |
"dep:console", | |
"dep:log4rs", | |
"vendored-openssl", | |
] |
src-tauri/Cargo.toml
Outdated
os_info = "3.12.0" | ||
|
||
|
||
clap_complete = "4.5.58" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add this to the cli dependencies and make it optional and install only if cli feature is enabled?
Also it would be nice if you update the documentation according to the cli change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. Just couple of nitpicks, as the clap_complete is for cli part, it should be optional dependency under the cli feature like the other cli dependencies (you can see that in cargo.toml)
Also if you are adding this functionality, you should also mention it in the documentation.
and last nitpick is that we do not use the 'feature/fix/something' prefix in the PR names, but on the other hands there should be the ticket designation present.
Also the man page should be updated with this.
Otherwise it LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvements. LGTM!
just please do not forget to squash the commits during the merge
…ompletion scripts
added clap as optional and cli dependency added the documentation and examples
Description
Added the Completions command to help generate the inline cli completions for shells.
Implements # (EIM-211)
Testing
For testing on macos we can run these commands to see the affect of it for the completion feature
Checklist
Before submitting a Pull Request, please ensure the following: