-
Notifications
You must be signed in to change notification settings - Fork 179
Added tab completion for mbed cli on bash #450
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
Conversation
700 lines of script for just a completion??? it looks like same piece of code is repeating over and over again. |
@mbartling Please check @SeppoTakalo's comment. Perhaps his script can be reused. |
There is a lot of repetition in the code, but I did this for clarity vs brevity. @theotherjimmy what do you think? |
Also @SeppoTakalo, most of the lines look like this:
So the script looks way bigger than it actually is |
@SeppoTakalo You did in ~77 lines about 1/10th of the amount of tab completion in this PR. If you look, things like you snippet is repeated for |
@mbartling Thanks for the PR. I agree with the simplicity vs brevity approach too. We still need to be aware about maintaining the list of options in the bash file. Perhaps this could be generated somehow? |
@screamerbg May be we should generate this file using the mbed-cli help? I mentally generated this script via
|
This is what I have so far for a generation script
Both the regexes work |
@mbartling This is great! Have you tried the generated output? |
Still working on it. Going to be out of town most of next week, but it shouldn't take too much longer to word for word generate the bash completion script |
…ure extra whitespace and strings. I tried setting it to be a pessimistic pony but it didn't work.
LGTM? |
@mbartling Can you add a paragraph and a link in README.md about tab competition and point to the extended documentation under tools/bash_completion/templates/README.md ? |
@mbartling To clarify - I'd like some instructions that will allow every user to take advantage of this. E.g. generate file, put it in folder A on system X or in folder B on system Y. |
Will do this now |
@mbartling Do you feel ready for this to be merged and released in 1.1? |
Yes to the current mbed bash completion script, but no to the generator. Still waiting on #460 and ARMmbed/mbed-os#3993 |
@mbartling To be clear, Is this PR ready to be merged? If not, what are we waiting on? |
This PR can be merged as is, but the generator is not usable/integratabtle until #460 and ARMmbed/mbed-os#3993 get merged |
@mbartling Thanks for the PR. LGTM |
FYI, this is only the bash file for tab completion. It is expected to go in some
DIR/etc/bash_completion.d/
directory. For example it goes into/usr/local/etc/bash_completion.d/
on my mac.Can someone help with the installation?