Move verbose into Config; drop resolveVerbose
Verbose was awkwardly a separate runKeeper argument with a separate resolveVerbose helper, even though it's just another tunable on the same precedence ladder as the numeric fields. This commit collapses it. Changes: - Config gains 'readonly verbose: boolean'. DEFAULT_CONFIG sets it to false. - resolveConfig now returns the full Config including verbose. Verbose layers with the same 'first defined value wins' precedence as the numeric fields. - resolveVerbose is gone. - ParsedCliArgs.verbose becomes boolean | undefined: undefined when -V was not passed, true when it was. parseCliArgs maps accordingly. This lets the layered resolver treat verbose uniformly. - runKeeper takes a single Config arg. The internal logger reads from config.verbose at the top of runKeeper. - move.ts no longer plumbs verbose separately; the single resolved Config drives everything. - README How-it-works and Files-table entries updated to match. Behavior verified for all five verbose-precedence cases (no file/no flag, no file/-V, file:true/no flag, file:false/-V, file:false/no flag) and config-error scenarios remain intact.
This commit is contained in:
+8
-2
@@ -49,7 +49,13 @@ export interface ParsedCliArgs {
|
||||
checkInterval: number | undefined; // seconds
|
||||
stepDelay: number | undefined; // milliseconds
|
||||
stepCount: number | undefined; // pixels
|
||||
verbose: boolean;
|
||||
/**
|
||||
* `true` when `-V`/`--verbose` was passed; `undefined` when it was not.
|
||||
* `undefined` (not `false`) lets the layered resolver distinguish "user
|
||||
* did not specify" from a hypothetical "user explicitly turned off",
|
||||
* even though the CLI has no off-switch today.
|
||||
*/
|
||||
verbose: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +111,7 @@ export function parseCliArgs(): ParsedCliArgs {
|
||||
checkInterval: parsePositiveNumber("check-interval", values["check-interval"] as string | undefined),
|
||||
stepDelay: parsePositiveNumber("step-delay", values["step-delay"] as string | undefined),
|
||||
stepCount: parsePositiveNumber("step-count", values["step-count"] as string | undefined),
|
||||
verbose: Boolean(values.verbose),
|
||||
verbose: values.verbose === true ? true : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user