Add getOpt function

Allows to get a previously set option.