Simplify setup-endpoints option processing.

Better code FTW.

Change-Id: Ice94f441303eb6607a0a132206effe3a6f1c084d