Skip to content

Commit

Permalink
Added command list to 'unknownCommand' theme event
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukairo-02 committed Jul 26, 2024
1 parent 4c97ab8 commit 6409acc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@drizzle-team/brocli",
"type": "module",
"author": "Drizzle Team",
"version": "0.9.1",
"version": "0.9.2",
"description": "Typed CLI command runner",
"license": "Apache-2.0",
"sideEffects": false,
Expand Down
1 change: 1 addition & 0 deletions src/command-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ const getCommand = (commands: Command[], args: string[], cliName?: string) => {
if (!command) {
throw new BroCliError(undefined, {
type: 'unknownCommandEvent',
commands,
cliName,
offender: firstCandidate.data,
});
Expand Down
1 change: 1 addition & 0 deletions src/event-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type UnrecognizedArgsEvent = {

export type UnknownCommandEvent = {
type: 'unknownCommandEvent';
commands: Command[];
cliName: string | undefined;
offender: string;
};
Expand Down
1 change: 1 addition & 0 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ describe('Parsing tests', (it) => {

expect(eventMocks.unknownCommandEvent.mock.lastCall).toStrictEqual([{
type: 'unknownCommandEvent',
commands,
cliName: undefined,
offender: 'unknown',
}] as BroCliEvent[]);
Expand Down

0 comments on commit 6409acc

Please sign in to comment.