functional option parsing