This makes perfect sense, but I'd be concerned that if we ever screwed something up, this would fail very quietly.

Could you either 1) make this print something to stderr if the arg isn't there.  this way, the error will get surfaced in xctool.  or 2), could you make it assert that the arg is there?  that'll be loud enough to catch our attention.