Revised to use `optparse` only.