Conversation
Complete commands/subcommands, devices, networks, SSID with spaces. No handling of `set-property` and `debug connect|roam` completions. Not tested with `ap/ad-hoc` devices as my device does not handle it. Implementation of `hidden-networks completion using quotes to handle completion on `:`.
Use a mocked implementation to test network/interfaces completion.
| station) | ||
| [[ $subcmd == list ]] && return | ||
| # All arguments except $prev and trailing empty argument | ||
| local iwctl_args=("${words[@]::${#words[@]}-2}") |
There was a problem hiding this comment.
Here I need to call iwctl station wlan0 get-networks so try to get rely on words to get everything except the connect in iwctl station wlan0 connect.
There might be options provided in here, as long as the option are given just after iwctl all this will work well, but if not, I know this might break but not sure what would be the correct way of handling it. I thought about generating a whole new array with options removed, but was not sure if it it was necessary to add it, or if there was already a preferred way of handling it.
|
Thank you for working on making bash completions better. But to verify, did you notice the two few paragraphs of CONTRIBUTING.md as linked in the PR creation view, in particular:
If you considered submitting it upstream, let's include the explanation why submit it here instead. If it was asked upstream and rejected there, let's add a link to the response. |
|
No I did not submit it upstream indeed. I'll try. I did notice that it was submitted for fish-shell separately though: fish-shell/fish-shell#9932 |
Complete commands/subcommands, devices, networks, SSID with spaces.
No handling of
set-propertyanddebug connect|roamcompletions.Not tested with
ap/ad-hocdevices as my device does not handle it.Implementation of
hidden-networks completion using quotes to handle completion on:`.Split commits
In separate commits, as I am not sure if it is wanted, I added support to not show any completion when nothing should be displayed, and some testing using a mock command to show parsing of real command outputs to find devices/networks.
These could be squashed together in the same commit, just thought it would be easier to review and remove them if needed.
#### Inspiration
I did look at
ip.bashas an inspiration.Style
If any implementation style is not found appropriate, and there is a better file to look into/change this, please tell and I'll adapt it.
Testing
I did interactively test everything supported at some point.
Added plenty of unit tests to try validating what I did. I did not work in TDD with these though as was more learning how to write things, read documentation and testing multiple things at once. So there might be tests that at the end do not test correctly as not finding a completion for other reasons.
With skipped tests being the one I cannot run on my machine, hoping they would work elsewhere.
Commit-hooks
It seems that the hook for
mypyjust always fails, no information on why.When run manually it seems happy. Not sure what to do here.
I did try resetting and re-committing everything at once, and only this did fail.
Each of the commit might not pass hooks as I do not know how to re-execute hooks on a
git commit --amendand all.