fix: enable positional options so -o works on subcommands
Remove global -o/--output from parent program and enable enablePositionalOptions() so -o yaml/json is parsed by subcommands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,9 +24,10 @@ describe('createProgram', () => {
|
||||
expect(status).toBeDefined();
|
||||
});
|
||||
|
||||
it('has output option', () => {
|
||||
it('subcommands have output option', () => {
|
||||
const program = createProgram();
|
||||
const opt = program.options.find((o) => o.long === '--output');
|
||||
const get = program.commands.find((c) => c.name() === 'get');
|
||||
const opt = get?.options.find((o) => o.long === '--output');
|
||||
expect(opt).toBeDefined();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user