setGlobalOptions.rd function

Produce a function which can get or set global options