Update ts to use more robust option parsing loop
Update ts to use more robust option parsing loop

See previous commit.  Also takes the opportunity to cleanup the formatting of
option handling.

ThomasAdam/ts,thinkerbot/ts