Lift some option parsing from Mosh