@@ -4,7 +4,7 @@ const path = require("path");
44const { LanguageMeta, detectLanguage } = require("../type-generation/languages/language");
55const { Command, Option, Argument } = require("commander");
66const { localConfig } = require("../config");
7- const { success, log, actionRunner } = require("../parser");
7+ const { success, log, warn, actionRunner } = require("../parser");
88const { PHP } = require("../type-generation/languages/php");
99const { TypeScript } = require("../type-generation/languages/typescript");
1010const { Kotlin } = require("../type-generation/languages/kotlin");
@@ -59,19 +59,23 @@ const typesLanguageOption = new Option(
5959 .default("auto");
6060
6161const typesStrictOption = new Option(
62- "-s, --strict",
63- "Enable strict mode to automatically convert field names to follow language conventions"
62+ "-s, --strict < value > ",
63+ "Disable strict mode to not automatically convert field names to follow language conventions"
6464)
65- .default(false);
65+ .choices(["true", "false"])
66+ .default("true");
6667
6768const typesCommand = actionRunner(async (rawOutputDirectory, {language, strict}) => {
6869 if (language === "auto") {
6970 language = detectLanguage();
7071 log(`Detected language: ${language}`);
7172 }
7273
74+ strict = strict === "true" || strict === true;
7375 if (strict) {
7476 log(`Strict mode enabled: Field names will be converted to follow ${language} conventions`);
77+ } else {
78+ warn(`Strict mode disabled: Field names will not be converted to follow ${language} conventions`);
7579 }
7680
7781 const meta = createLanguageMeta(language);
0 commit comments