17 lines
546 B
TypeScript
17 lines
546 B
TypeScript
import type { ArgumentsCamelCase } from "yargs"
|
|
import { CLICommand } from "../cli/CLICommand"
|
|
import { parseTodoFile } from "../file"
|
|
|
|
export class SprintsCommand extends CLICommand {
|
|
readonly name = "sprints"
|
|
readonly help = "List all sprints"
|
|
readonly description = "List all sprints in the TODO file"
|
|
|
|
async execute(args: ArgumentsCamelCase): Promise<number> {
|
|
const todo = await parseTodoFile()
|
|
for (const sprint of todo.sprints) {
|
|
console.log(`${sprint.name}: ${sprint.start}..${sprint.end}`)
|
|
}
|
|
return 0
|
|
}
|
|
}
|