| 190 | ] |
| 191 | |
| 192 | function header(width: number): string[] { |
| 193 | // Box-drawing header. The inner content is padded so the right edge |
| 194 | // lines up regardless of color codes. |
| 195 | const inner = width - 4 |
| 196 | const tagline = 'ZenNotes CLI · capture, search, edit your vault from any terminal' |
| 197 | const titleLine = `${bold(cyan('zn'))} ${dim(`v${HELP_VERSION}`)}` |
| 198 | const taglineWrapped = wrapLines(tagline, inner).map((l) => dim(l)) |
| 199 | const lines = [titleLine, ...taglineWrapped] |
| 200 | const top = '╭' + '─'.repeat(width - 2) + '╮' |
| 201 | const bottom = '╰' + '─'.repeat(width - 2) + '╯' |
| 202 | const middle = lines.map((l) => '│ ' + pad(l, inner) + ' │') |
| 203 | return [top, ...middle, bottom] |
| 204 | } |
| 205 | |
| 206 | function section(heading: string, rows: CommandRow[], width: number): string[] { |
| 207 | const out: string[] = [] |