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

Fix declared flags option #2433

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ export class Application extends ChildableComponent<
} catch (error) {
ok(error instanceof Error);
if (reportErrors) {
this.logger.error(error.message);
this.logger.error(
`Failed to set option ${key}: ${error.message}`,
);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/options/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export class Options {
);

if (declaration.type === ParameterType.Flags) {
Object.assign(this._values[declaration.name] as any, converted);
Object.assign(this._values[declaration.name] || {}, converted);
} else {
this._values[declaration.name] = converted;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/options/readers/tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class TSConfigReader implements OptionsReader {
);
} catch (error) {
ok(error instanceof Error);
logger.error(error.message);
logger.error(`Failed to set option ${key}: ${error.message}`);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/options/readers/typedoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class TypeDocReader implements OptionsReader {
);
} catch (error) {
ok(error instanceof Error);
logger.error(error.message);
logger.error(`Failed to set option ${key}: ${error.message}`);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/utils/options/readers/typedoc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe("Options - TypeDocReader", () => {
{
someOptionThatDoesNotExist: true,
},
"error: Tried to set an option (someOptionThatDoesNotExist) that was not declared. You may have meant:*",
"error: Failed to set option someOptionThatDoesNotExist: Tried to set an option (someOptionThatDoesNotExist) that was not declared. You may have meant:*",
);
testError(
"Errors if extends results in a loop",
Expand Down