(vault: string, args: ParsedArgs)
| 78 | } |
| 79 | |
| 80 | export async function cmdRead(vault: string, args: ParsedArgs): Promise<void> { |
| 81 | const rel = requirePath(args) |
| 82 | const note = await readNote(vault, rel) |
| 83 | if (getBool(args, 'json')) { |
| 84 | emitJson(note) |
| 85 | return |
| 86 | } |
| 87 | if (getBool(args, 'meta')) { |
| 88 | const { body: _body, ...meta } = note |
| 89 | emitJson(meta) |
| 90 | return |
| 91 | } |
| 92 | process.stdout.write(note.body) |
| 93 | if (!note.body.endsWith('\n')) process.stdout.write('\n') |
| 94 | } |
| 95 | |
| 96 | export async function cmdCreate(vault: string, args: ParsedArgs): Promise<void> { |
| 97 | const folder = parseFolderFlag(getString(args, 'folder')) ?? 'inbox' |
nothing calls this directly
no test coverage detected