puppetlabs/puppetdb — pull request #433 by cprice-puppet (2013-02-11 23:50:55+00:00)
Title: Generalize and improve our utility function for parsing CLI args

At some point in time the clojure CLI library that we use to parse
stopped supporting a flag to indicate 'required' arguments. Thus,
we were getting much farther into the code than we should have been
if you left off, e.g., the `--config` option to the `services`
program. This also resulted in useless, unintuitive error messages.

Additionally, the function that we were providing in `utils` to
generalize our CLI argument handling for other PuppetDB command-line
tools included more arguments than would be applicable to some
tools.

This commit provides a more generalized `validate-cli-args!` function
in the utils namespace, which doesn't assume any arguments besides
`--help`. It also adds support for checking for `required` arguments
and fails with a reasonable error message if you are missing any.