The first condition here is incorrect, as it will match `-l` anywhere in the string. Should be `^-[lL]`.