flux-framework/flux-core — pull request #48 by garlick (2014-10-10 23:04:46+00:00)
Title: add convenience accessors to optparse.c, use them in flux-start and wrexecd

Added a few convenience functions to optparse.c that were useful in converting flux-start from getopt_long to optparse.

These functions print an error and exit if an unregeistered option was specified by the program or if the user provided an incorrectly formatted argument to an option. That behavior can be overridden by setting OPTPARSE_FATALERR_FN (and optionally FATALERR_HANDLE).

Unit tests were added for the new functions.

wrexecd had an internal function that overlapped with the new optparse_get_int() call of the same name, therefore it was converted to the new one, and utilizes the FATALERR_FN override to get errors logged via its internal log_fatal() function.