Skip to content

Commit 6513fc4

Browse files
committed
feat: default value for option
1 parent 03e3a46 commit 6513fc4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

api/src/unraid-api/cli/logs.command.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ECOSYSTEM_PATH, PM2_PATH } from '@app/consts';
55
import { LogService } from '@app/unraid-api/cli/log.service';
66

77
interface LogsOptions {
8-
lines: number
8+
lines: number;
99
}
1010

1111
@Command({ name: 'logs' })
@@ -14,9 +14,8 @@ export class LogsCommand extends CommandRunner {
1414
super();
1515
}
1616

17-
@Option({ flags: '-l, --lines', description: 'Number of lines to tail'})
18-
parseLines(input: string): number
19-
{
17+
@Option({ flags: '-l, --lines <lines>', description: 'Number of lines to tail', defaultValue: 100 })
18+
parseLines(input: string): number {
2019
const parsedValue = parseInt(input);
2120
return Number.isNaN(parsedValue) ? 100 : parsedValue;
2221
}

0 commit comments

Comments
 (0)