Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Command parent property to TypeScript #1475

Merged
merged 1 commit into from Feb 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -156,8 +156,8 @@ declare namespace commander {

interface Command {
args: string[];

commands: Command[];
parent: Command | null;

/**
* Set the program version to `str`.
Expand Down
1 change: 1 addition & 0 deletions typings/index.test-d.ts
Expand Up @@ -21,6 +21,7 @@ expectType<commander.Command>(commander.createCommand());
// Command properties
expectType<string[]>(program.args);
expectType<commander.Command[]>(program.commands);
expectType<commander.Command | null>(program.parent);

// version
expectType<commander.Command>(program.version('1.2.3'));
Expand Down