refine option parsing a bit

My wish is to put minimal code inside the getopt() switch. So I've added
a Dflag for option '-D' and a new function show_devices_and_exit().