bash-completion icon indicating copy to clipboard operation
bash-completion copied to clipboard

Add basic completion for 'iw'

Open Synray opened this issue 6 years ago • 3 comments

Only completes up to the 4th level of a command, at the moment. And only for commands starting with iw dev. The rest will come next, though this completion covers all of the most frequently used, as well as the iw help commands. External: sed and _available_interfaces (iwconfig / ip).

Synray avatar Apr 16 '18 09:04 Synray

Completion for all "iw dev" commands.

I'll probably try to refactor the duplicate completions. It's not wrapped at column 79 yet, but besides that is the code style correct?

Synray avatar Apr 23 '18 08:04 Synray

Sorry it's been a while since I worked on this. I don't really use iw anymore, but since I think iw's horrendous syntax (and tendency to barf unsorted help to stdout when it fails) creates a drastic need for bash completion, I'll try to finish this.

I made the style changes you requested, apart from wrapping all the lines to 79 characters (which I'll do once the code is relatively stable). I also added completion for iw phy. The 3 commits were then squashed into one.

I'll add a test case next.

Synray avatar Jan 08 '19 07:01 Synray

Added a test, I looked at some other tests, but the length of each varies a lot, so let me know if I should add more to it.

Synray avatar Sep 21 '19 05:09 Synray