add length functions to optionSpec