From 1b559487495f623d6f96d6813a3c461dbad7ea1a Mon Sep 17 00:00:00 2001 From: John Gee Date: Sat, 9 Sep 2023 11:53:16 +1200 Subject: [PATCH] Add Command.options property, and make it and Command.commands readonly --- index.d.ts | 3 ++- tests/commander.test-d.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 0d7b487..0c82241 100644 --- a/index.d.ts +++ b/index.d.ts @@ -453,7 +453,8 @@ export class CommanderError extends Error { export class Command { args: string[]; processedArgs: Args; - commands: CommandUnknownOpts[]; + readonly commands: readonly CommandUnknownOpts[]; + readonly options: readonly Option[]; parent: CommandUnknownOpts | null; constructor(name?: string); diff --git a/tests/commander.test-d.ts b/tests/commander.test-d.ts index d9a0e73..0fee67f 100644 --- a/tests/commander.test-d.ts +++ b/tests/commander.test-d.ts @@ -40,7 +40,8 @@ expectType(commander.createArgument('')); expectType(program.args); // eslint-disable-next-line @typescript-eslint/no-explicit-any expectType<[]>(program.processedArgs); -expectType(program.commands); +expectType(program.commands); +expectType(program.options); expectType(program.parent); // version