Simplify subcommand option parsing by moving it out of the loop