@@ -7,6 +7,7 @@ import { TemplatesGenConfig } from "./src/commands/generate-templates/configurat
77import { CodeGenConfig } from "./src/configuration.js" ;
88import { HTTP_CLIENT } from "./src/constants.js" ;
99import { generateApi , generateTemplates } from "./src/index.js" ;
10+ import type { HttpClientType } from "./types/index.js" ;
1011
1112const templateGenBaseConfig = new TemplatesGenConfig ( { } ) ;
1213
@@ -52,18 +53,21 @@ const generateTemplatesCommand = defineCommand({
5253 description : "Output only errors to console" ,
5354 default : templateGenBaseConfig . silent ,
5455 } ,
56+ debug : {
57+ type : "boolean" ,
58+ description : "additional information about processes inside this tool" ,
59+ default : templateGenBaseConfig . debug ,
60+ } ,
5561 } ,
5662 run : async ( { args } ) => {
57- if ( args . debug ) consola . level = Number . MAX_SAFE_INTEGER ;
58- if ( args . silent ) consola . level = 0 ;
59-
6063 await generateTemplates ( {
6164 cleanOutput : args [ "clean-output" ] ,
62- httpClientType : args [ "http-client" ] ,
65+ httpClientType : args [ "http-client" ] as HttpClientType ,
6366 modular : args . modular ,
6467 output : args . output ,
6568 rewrite : args . rewrite ,
6669 silent : args . silent ,
70+ debug : args . debug ,
6771 } ) ;
6872 } ,
6973} ) ;
@@ -274,9 +278,6 @@ const generateCommand = defineCommand({
274278 } ,
275279 } ,
276280 run : async ( { args } ) => {
277- if ( args . debug ) consola . level = Number . MAX_SAFE_INTEGER ;
278- if ( args . silent ) consola . level = 0 ;
279-
280281 let customConfig ;
281282
282283 if ( args [ "custom-config" ] ) {
0 commit comments