implemented long option parsing