(#14901) Simplify argument handling in option parser
Option specification had been done with a series of shifts and pops to
handle an optional second parameter. Checking the length of the
arguments array is an easier to understand way of achieving this.