options.bool.small.combined.test.js
This file
Path
tests/options.bool.small.combined.test.js
15 lines · 485 bytes · JavaScript
Last changed by
Switching to esm-only (#2464)John Geebefore adoptionf4bd470
History of this fileTake it
12345678910111213141516import * as commander from '../index.js';import { test } from 'node:test';import assert from 'node:assert/strict';
test('when when multiple short flags specified then parsed as short option group', () => { const program = new commander.Command(); program .option('-p, --pepper', 'add pepper') .option('-c, --cheese', 'add cheese');
program.parse(['node', 'test', '-pc']);
assert.equal(program.opts().pepper, true); assert.equal(program.opts().cheese, true);});