get-option: get option from the command line or config file

Refactor the use of multiple similar calls to 'option-ref' into a
function that implements that pattern. Saves a surprising number of
lines.