add option -l and -L, reorganize option handler