Skip to content

Add basic completion for 'iw' #200

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add basic completion for 'iw' #200

wants to merge 1 commit into from

Conversation

Synray
Copy link

@Synray Synray commented Apr 16, 2018

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
Copy link
Author

Synray commented Apr 23, 2018

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?

Copy link
Owner

@scop scop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay. Regarding code style, there are a couple of things to do:

  • use spaces (only) for indentation, not tabs
  • use space between $( and the command following it
  • use == instead of = within [[ ]]

I'll have a proper look later, but in the meantime, fixing the above wouldn't hurt.

Something I will also want for this before inclusion is tests for the test suite, at least a basic one.

@Synray
Copy link
Author

Synray commented Jan 8, 2019

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 Synray force-pushed the iw branch 4 times, most recently from ab0b6b4 to 4cb3cf7 Compare September 21, 2019 05:32
@Synray
Copy link
Author

Synray commented Sep 21, 2019

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 Synray requested a review from scop September 21, 2019 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants