@@ -3,16 +3,18 @@ import { resolve } from '@css-modules-kit/core';
33import packageJson from '../package.json' with { type : 'json' } ;
44import { ParseCLIArgsError } from './error.js' ;
55
6+ // NOTE: Keep this help text in sync with the one in packages/codegen/README.md.
67const helpText = `
78Usage: cmk [options]
89
910Options:
10- --help, -h Show help information
11- --version, -v Show version number
12- --project, -p The path to its configuration file, or to a folder with a 'tsconfig.json'.
13- --pretty Enable color and formatting in output to make errors easier to read.
14- --clean Remove the output directory before generating files. [default: false]
15- --watch, -w Watch for changes and regenerate files. [default: false]
11+ --help, -h Show help information
12+ --version, -v Show version number
13+ --project, -p The path to its configuration file, or to a folder with a 'tsconfig.json'.
14+ --pretty Enable color and formatting in output to make errors easier to read.
15+ --clean Remove the output directory before generating files. [default: false]
16+ --watch, -w Watch for changes and regenerate files. [default: false]
17+ --preserveWatchOutput Disable wiping the console in watch mode. [default: false]
1618` ;
1719
1820export function printHelpText ( ) : void {
@@ -32,6 +34,7 @@ export interface ParsedArgs {
3234 pretty : boolean | undefined ;
3335 clean : boolean ;
3436 watch : boolean ;
37+ preserveWatchOutput : boolean ;
3538}
3639
3740/**
@@ -49,6 +52,7 @@ export function parseCLIArgs(args: string[], cwd: string): ParsedArgs {
4952 pretty : { type : 'boolean' } ,
5053 clean : { type : 'boolean' , default : false } ,
5154 watch : { type : 'boolean' , short : 'w' , default : false } ,
55+ preserveWatchOutput : { type : 'boolean' , default : false } ,
5256 } ,
5357 allowNegative : true ,
5458 } ) ;
@@ -59,6 +63,7 @@ export function parseCLIArgs(args: string[], cwd: string): ParsedArgs {
5963 pretty : values . pretty ,
6064 clean : values . clean ,
6165 watch : values . watch ,
66+ preserveWatchOutput : values . preserveWatchOutput ,
6267 } ;
6368 } catch ( cause ) {
6469 throw new ParseCLIArgsError ( cause ) ;
0 commit comments