-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: auto inject completions #139
Conversation
@Tpuljak PR is ready for review. |
9f153c5
to
dd9aa56
Compare
@Tpuljak removed that commit. |
@Tpuljak pushed the changes that fixes that issue 👍🏻 |
@Tpuljak made the required changes. |
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 code is now inline without codebase and the command does update the profile with the completion script. Good work!
The issue now is that the completion script does not seem correct.
For me, the completion script just autocompletes paths when called.
For example:
daytona c
+ TAB does not suggest daytona create
but simply fills in a directory that starts with c
.
If it works for you as intended, let me know. If not, please look into this.
@idagelic might be useful in this conversation. He implemented completions for one of our other CLI tools.
@Tpuljak It works fine for Bash + Fish + ZSH (Manual + new shell). |
@35C4n0r you're right. I can confirm that the completions work. The issue I mentioned above was related to my Warp terminal. All good. Approving the PR. |
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.
Awesome work!
This looks good, thanks for the PR @35C4n0r ! The Cobra default "completion" command prints out the completion script results to stdout. Users might expect this behavior and use it for some custom shell profile configs. Should we leave this option to the user but perhaps just hide it from help to avoid confusion using spf13/cobra#1541 ? In that case there would be no unexpected behavior to the user and we could rename this new command to "autocomplete" just as the go file is called. Does this make sense to you? @Tpuljak |
@idagelic made the required changes. |
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.
Thank you @35C4n0r
Pull Request Title
Automate Shell Completion Configuration
Description
Adds automatic injection of the autocomplete script into the appropriate shell profile and then instructing the user on how to source the file (or instruct to open a new terminal).
Type of Change
Checklist
Related Issue(s)
This PR addresses issue #49
Closes #49
/claim #49
Screenshots
Notes
Please add any relevant notes if necessary.