File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -269,22 +269,13 @@ def main():
269269 "--add-udev-rule" ,
270270 action = "store_true" ,
271271 dest = "udev" ,
272- help = "Add udev rule to access BlinkSticks without root permissions. Must be run as root." ,
272+ help = "Add udev rule to access BlinkSticks without root permissions. Must be run as root e.g. `sudo $(which blinkstick) --add-udev-rule` ." ,
273273 )
274274
275275 parser .add_option_group (group )
276276
277277 (options , args ) = parser .parse_args ()
278278
279- if options .serial is None :
280- sticks = find_all ()
281- else :
282- sticks = [find_by_serial (options .serial )]
283-
284- if len (sticks ) == 0 :
285- print ("BlinkStick with serial number " + options .backend + " not found..." )
286- return 64
287-
288279 # Global action
289280 if options .udev :
290281
@@ -307,6 +298,15 @@ def main():
307298 print ("Reboot your computer for changes to take effect" )
308299 return 0
309300
301+ if options .serial is None :
302+ sticks = find_all ()
303+ else :
304+ sticks = [find_by_serial (options .serial )]
305+
306+ if len (sticks ) == 0 :
307+ print ("BlinkStick with serial number " + options .serial + " not found..." )
308+ return 64
309+
310310 for stick in sticks :
311311 if options .inverse :
312312 stick .set_inverse (True )
You can’t perform that action at this time.
0 commit comments