Skip to content
Myr

add tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

refactor the allowUnknown function

authored by zhiyelee · committed by zhiyelee · parent c03bf0b · Browse files · 2 files+41 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+41 added−2 removed

  • tests:+38 added−0 removed
  • other:+3 added−2 removed

2 files+41 added−2 removed

added:test/test.options.unknown.js+38 added
modified:index.js+3 added-2 removed
393 unmodified lines
394395/**396 * Allow unknown options on the command line.397 *398 * @param {Boolean} arg398 * @param {Boolean} arg if `true` or omitted, no error will be thrown399 * for unknown options.400 * @api public401 */402Command.prototype.allowUnknown = function(arg) {402 this._allowUnknown = !!arg;403 this._allowUnknown = arguments.length === 0 || arg;404 return this;405}406407/**
593 unmodified lines