Fixes option parsing in legacy commands

Global options must be at the start of the arguments before the command
but we simply prepended the command to the start of the args.

This actually does a first pass at parsing out the options and injects
the command between the globals and the remaining args.