Skip to content

Commit 668aad6

Browse files
authoredFeb 7, 2021
fix: ensure verbosity flag is enabled for config (#266)
1 parent 9b0b206 commit 668aad6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
 

‎src/cli.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ async function main() {
111111
flags = await getConfig(cli.flags);
112112

113113
const start = Date.now();
114-
const verbosity = parseVerbosity(cli.flags);
115-
const format = parseFormat(cli.flags);
114+
const verbosity = parseVerbosity(flags);
115+
const format = parseFormat(flags);
116116
const logger = new Logger(verbosity, format);
117117

118118
logger.error(`🏊‍♂️ crawling ${cli.input}`);
@@ -270,7 +270,7 @@ async function main() {
270270
);
271271
}
272272

273-
function parseVerbosity(flags: typeof cli.flags): LogLevel {
273+
function parseVerbosity(flags: Flags): LogLevel {
274274
if (flags.silent && flags.verbosity) {
275275
throw new Error(
276276
'The SILENT and VERBOSITY flags cannot both be defined. Please consider using VERBOSITY only.'
@@ -292,7 +292,7 @@ function parseVerbosity(flags: typeof cli.flags): LogLevel {
292292
return LogLevel[verbosity as keyof typeof LogLevel];
293293
}
294294

295-
function parseFormat(flags: typeof cli.flags): Format {
295+
function parseFormat(flags: Flags): Format {
296296
if (!flags.format) {
297297
return Format.TEXT;
298298
}

‎src/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export interface Flags {
1010
skip?: string;
1111
format?: string;
1212
silent?: boolean;
13+
verbosity?: string;
1314
timeout?: number;
1415
markdown?: boolean;
1516
serverRoot?: string;

0 commit comments

Comments
 (0)
Please sign in to comment.