keithrbennett / wifiwand

A command line tool to manage wifi, including an interactive shell (currently Mac only)
Apache License 2.0
66 stars 6 forks source link

Improve handling of wifi operations when wifi is off #15

Closed keithrbennett closed 6 years ago

keithrbennett commented 6 years ago

Several commands don't make sense when wifi is turned off, such as showing the available networks. Also, the info hash includes some information that will not be available.

Review how this works now (e.g. does 'ci' take a long time to fail? Is an error raised on some operation?) and fix it, for all applicable commands.

Steps:

1) Identify the commands that need to specially handle the wifi off state. 2) Determine best way to deal with wifi off for these, and for the info hash. 3) Implement those approaches.

keithrbennett commented 6 years ago

Fixed in commit 7b9d6d7c6edaf2cece039650ecde1630a595d450.

Several operations now return nil when wifi is off.

For available networks, nil when wifi off can be differentiated from [] when wifi on and no networks were found.