build: opt: Add proper option parsing

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>