I'm not really happy with referring to global positional arguments inside a function like this; I'd rather we pass the right thing into it in the first place.

I've been meaning for a while to replace the homegrown argument parser with something more robust; that would help with this.