Speaking in a broader sense than this commit, if you pass all the values a function needs to produce its output, those functions will become much easier to compose, unit test, and perhaps most importantly: comprehend as discreet units of work.

If you rely on global state (in this case, the options variable), in order to understand what might be happening inside a method, you have to understand every single part of the program that might touch your global state.  In a program this small, the issue is minor, but following this general principal everywhere will help prevent you from making giant hairballs of code.

This style of coding is one important part of what is called "functional programming".  If you've never heard of it, prepare to go down the rabbit hole because it will totally upend the way you write programs (for the better) :)