mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
feat: default value for option
This commit is contained in:
@@ -5,7 +5,7 @@ import { ECOSYSTEM_PATH, PM2_PATH } from '@app/consts';
|
|||||||
import { LogService } from '@app/unraid-api/cli/log.service';
|
import { LogService } from '@app/unraid-api/cli/log.service';
|
||||||
|
|
||||||
interface LogsOptions {
|
interface LogsOptions {
|
||||||
lines: number
|
lines: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command({ name: 'logs' })
|
@Command({ name: 'logs' })
|
||||||
@@ -14,9 +14,8 @@ export class LogsCommand extends CommandRunner {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option({ flags: '-l, --lines', description: 'Number of lines to tail'})
|
@Option({ flags: '-l, --lines <lines>', description: 'Number of lines to tail', defaultValue: 100 })
|
||||||
parseLines(input: string): number
|
parseLines(input: string): number {
|
||||||
{
|
|
||||||
const parsedValue = parseInt(input);
|
const parsedValue = parseInt(input);
|
||||||
return Number.isNaN(parsedValue) ? 100 : parsedValue;
|
return Number.isNaN(parsedValue) ? 100 : parsedValue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user