The following just came to my mind: What about having getopt also generate a "Usage" string which you can output if any cmdline argument parsing error occured? Of course this would require adding a third field containing the description. (which would also be self-documenting)