-
-
Notifications
You must be signed in to change notification settings - Fork 394
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 basic implementation of tab completion #663
Conversation
recent versions of https://computingforgeeks.com/how-to-source-bash-completion-script-file-in-zsh/ |
|
I think I succeed in fixing the problem with env vars naming and fish compatibility. I also added a flag To test it:
Sourcing a script in The proper way to do it is to place I still have not added fqbn, cores, libraries completion. They require more work and I think I'll do it in a following PR. Is it ok for you? I still have to update the documentation accordingly. I'll do it as soon as I have your opinion on the PR. |
Will not work under my zsh, @umbynos |
I had missed the notification for this one, this is awesome! Great work! I tested the initial functionality, it seemed to work really well! I know the PR is still in progress, but it could be interesting to add some notes on how to use this, specially for people building for distribution (that way the generated completion files can be packaged already in the correct places). The functionality I tested is already pretty great, perhaps the |
Thank you! Currently I'm following this plan:
I'll try to improve the completion (add |
|
… (for shells that supports it)
add comments regarding "hacks" change Replacer with ReplaceAll (for readability)
@per1234 when you have time, could you please give a look to the documentation i've added please? 😄 |
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.
Very nice @umbynos! I gave it a quick try with bash and zsh and it worked great.
I only have a few nitpicky suggestions for the documentation.
fix typos and corrections Co-authored-by: per1234 <accounts@perglass.com>
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.
Tested with bash
and zsh
and it worked smoothly following the provided documentation.
Excellent!
* add basic implementation of bash completion * update cobra to 1.0.0 because of spf13/cobra#1048 * add support for zsh and fish, improved help messages * add flag ´--no-descriptions´ to disable automatic command description (for shells that supports it) * fix fish not supporting env variables with dash in the name * fixed zsh completion not working * revert "#compdef" patch * add check on --no-description flag add comments regarding "hacks" change Replacer with ReplaceAll (for readability) * add docs * Apply suggestions from code review fix typos and corrections Co-authored-by: per1234 <accounts@perglass.com> * forgot a space * fix fish docs * add test for completion Co-authored-by: per1234 <accounts@perglass.com>
Please check if the PR fulfills these requirements
feature
#649
add completion with TAB press. At the current time, the feature is very basic and only work for bash. I'm planning to add compatibility with fish and zsh. I'll also try to add the completion for lib and cores.
No breaking change.

To try the feature it's required to run
arduino-cli completion bash > completion.sh
and thensource completion.sh
See how to contribute