removed newline above and below errors
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Jared Petersen · committed by Roman Vanesyan · parent b6549f2 · Browse files · 4 files·+5 added−17 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+5 added−17 removed
- tests:+5 added−9 removed
- other:+0 added−8 removed
Provenance
- Commit
6c0c1f6- Tree
0b2e198- Author
Jared Petersen <jaredtoddpetersen@gmail.com>- Committer
Roman Vanesyan <romain.vanesyan@gmail.com>- Parent
b6549f2
4 files changed+5 added−17 removed
modified:test/test.command.allowUnknownOption.js+2 added-2 removed
11 unmodified lines121314151616171819202 unmodified lines2324252627272829303127 unmodified lines11 unmodified lines .version('0.0.1') .option('-p, --pepper', 'add pepper');program.parse('node test -m'.split(' '));
stubError.callCount.should.equal(3);stubError.callCount.should.equal(1);
// test subcommandresetStubStatus();2 unmodified lines .action(function () { });program.parse('node test sub -m'.split(' '));
stubError.callCount.should.equal(3);stubError.callCount.should.equal(1);stubExit.calledOnce.should.be.true();
// command with `allowUnknownOption`resetStubStatus();27 unmodified linesmodified:test/test.options.args.required.js+2 added-2 removed
12 unmodified lines1314151617181718192021224 unmodified lines12 unmodified lines};
process.on('exit', function (code) { code.should.equal(1); info.length.should.equal(3); info[1].should.equal("error: option `-c, --cheese <type>' argument missing"); info.length.should.equal(1); info[0].should.equal("error: option `-c, --cheese <type>' argument missing"); process.exit(0)});
program4 unmodified linesmodified:test/test.variadic.args.js+1 added-5 removed
55 unmodified lines5657585960616260636455 unmodified lines
process.exit = oldProcessExit;console.error = oldConsoleError;
[ '', 'error: variadic arguments must be last `variadicArg\'','error: variadic arguments must be last `variadicArg\''.should.eql(errorMessage); ''].join('\n').should.eql(errorMessage);modified:index.js-8 removed
790 unmodified lines791 * @api private792 */793 794 Command.prototype.missingArgument = function(name) {795- console.error();795 console.error("error: missing required argument `%s'", name);797- console.error();796 process.exit(1);797 };798 799 /**4 unmodified lines804 * @api private805 */806 807 Command.prototype.optionMissingArgument = function(option, flag) {810- console.error();808 if (flag) {809 console.error("error: option `%s' argument missing, got `%s'", option.flags, flag);810 } else {811 console.error("error: option `%s' argument missing", option.flags);812 }816- console.error();813 process.exit(1);814 };815 816 /**4 unmodified lines821 */822 823 Command.prototype.unknownOption = function(flag) {824 if (this._allowUnknownOption) return;829- console.error();825 console.error("error: unknown option `%s'", flag);831- console.error();826 process.exit(1);827 };828 829 /**3 unmodified lines833 * @api private834 */835 836 Command.prototype.variadicArgNotLast = function(name) {843- console.error();837 console.error("error: variadic arguments must be last `%s'", name);845- console.error();838 process.exit(1);839 };840 841 /**386 unmodified lines