I recently came across this bug, and it appears the fix is fairly trivial and consists of two parts:
#1. Move the --rw detection before the directory detection. rw is now always correctly detected
#2. Add a elif clause to detect if the second argument is a folder, but not the first, as is likely the case when the --rw flag is passed in. if it is, the shift the arguments, and do the same as the first if statement (ie. set the dirs variable)
I recently came across this bug, and it appears the fix is fairly trivial and consists of two parts:
#1. Move the --rw detection before the directory detection. rw is now always correctly detected
#2. Add a elif clause to detect if the second argument is a folder, but not the first, as is likely the case when the --rw flag is passed in. if it is, the shift the arguments, and do the same as the first if statement (ie. set the dirs variable)
Attached is my patch