hapijs/bossy — pull request #30 by smikes (2014-12-14 14:01:25+00:00)
Title: Optional noarg default

This is a change needed for https://github.com/hapijs/lab/issues/282 , where the desired behavior is

switch | action
--------|----------
'' | no linting
'-L' | use eslint
'-L eslint' | use eslint
'-L jslint' | use jslint

The logic is a little tortured because we need to distinguish cases 1,2,3 but only partial information is available at various times. Once the `-L` or `--lint` option has been seen, the `noargDefault` value is stored in `flags`. If there is no value for the argument, this latches. If an argument is seen, the argument overrides the `noargDefault`.

This PR is rebased onto #29 and should be applied after (or instead of #29). The code lints clean and passes all tests with 100% coverage.

`noargDefault` is a terrible name and I'd be happy to change it.