split the options parsing code into options.c