(vault: string, args: ParsedArgs)
| 19 | import { emitJson, emitLine, formatRelativeAge, pad } from '../format.js' |
| 20 | |
| 21 | export async function cmdVaultInfo(vault: string, args: ParsedArgs): Promise<void> { |
| 22 | const [notes, subfolders] = await Promise.all([listNotes(vault), listFolders(vault)]) |
| 23 | const counts = { |
| 24 | inbox: 0, |
| 25 | quick: 0, |
| 26 | archive: 0, |
| 27 | trash: 0 |
| 28 | } |
| 29 | for (const n of notes) counts[n.folder] += 1 |
| 30 | |
| 31 | const summary = { |
| 32 | vaultRoot: vault, |
| 33 | counts, |
| 34 | subfolderCount: subfolders.length |
| 35 | } |
| 36 | if (getBool(args, 'json')) { |
| 37 | emitJson(summary) |
| 38 | return |
| 39 | } |
| 40 | emitLine(`Vault: ${vault}`) |
| 41 | emitLine(` inbox: ${counts.inbox}`) |
| 42 | emitLine(` quick: ${counts.quick}`) |
| 43 | emitLine(` archive: ${counts.archive}`) |
| 44 | emitLine(` trash: ${counts.trash}`) |
| 45 | emitLine(` subfolders: ${subfolders.length}`) |
| 46 | } |
| 47 | |
| 48 | export async function cmdVaultList(_vault: string, args: ParsedArgs): Promise<void> { |
| 49 | const known = await readKnownVaultsFromConfig() |
nothing calls this directly
no test coverage detected