Procházet zdrojové kódy

feat: show word count in status command

majx_mac před 8 měsíci
rodič
revize
16c094496c
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      packages/cli/src/commands/status.ts

+ 4 - 0
packages/cli/src/commands/status.ts

@@ -31,7 +31,11 @@ export const statusCommand = new Command("status")
         log(`  ${book.title} (${id})`);
         log(`    Status: ${book.status}`);
         log(`    Platform: ${book.platform} | Genre: ${book.genre}`);
+        const totalWords = index.reduce((sum, ch) => sum + ch.wordCount, 0);
+        const avgWords = index.length > 0 ? Math.round(totalWords / index.length) : 0;
+
         log(`    Chapters: ${nextChapter - 1} / ${book.targetChapters}`);
+        log(`    Words: ${totalWords.toLocaleString()} (avg ${avgWords}/ch)`);
         log(`    Approved: ${approved} | Pending: ${pending} | Failed: ${failed}`);
         log("");
       }