feat: implement tm list with new refactored structure
This commit is contained in:
@@ -24,7 +24,7 @@ export interface ListCommandOptions {
|
||||
status?: string;
|
||||
tag?: string;
|
||||
withSubtasks?: boolean;
|
||||
format?: string;
|
||||
format?: OutputFormat;
|
||||
silent?: boolean;
|
||||
project?: string;
|
||||
}
|
||||
@@ -73,6 +73,7 @@ export class ListTasksCommand extends Command {
|
||||
* Execute the list command
|
||||
*/
|
||||
private async executeCommand(options: ListCommandOptions): Promise<void> {
|
||||
console.log('executeCommand', options);
|
||||
try {
|
||||
// Validate options
|
||||
if (!this.validateOptions(options)) {
|
||||
@@ -138,8 +139,7 @@ export class ListTasksCommand extends Command {
|
||||
*/
|
||||
private async initializeCore(projectRoot: string): Promise<void> {
|
||||
if (!this.tmCore) {
|
||||
this.tmCore = createTaskMasterCore(projectRoot);
|
||||
await this.tmCore.initialize();
|
||||
this.tmCore = await createTaskMasterCore({ projectPath: projectRoot });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ export function createTaskTable(
|
||||
if (showSubtasks && task.subtasks && task.subtasks.length > 0) {
|
||||
task.subtasks.forEach((subtask) => {
|
||||
const subRow: string[] = [
|
||||
chalk.gray(` └─ ${task.id}.${subtask.id}`),
|
||||
chalk.gray(` └─ ${subtask.id}`),
|
||||
chalk.gray(truncate(subtask.title, 36)),
|
||||
getStatusWithColor(subtask.status),
|
||||
chalk.gray(subtask.priority || 'medium')
|
||||
|
||||
Reference in New Issue
Block a user