fix: cover tui in the CLI inventory and drop the em-dashes it printed

The inventory test predates the `tui` command, so a rename or an
accidental removal would have gone unnoticed: it now asserts the command,
its `-l`/`--list` flag and its optional position operand.

The digest and search-result lines joined their halves with an em-dash,
which the repo's own convention rules out, so both now use the middle dot
the surrounding lines already use. The one em-dash left in `src/tui/` is
load-bearing: `search-service.ts` builds a session snippet with it, and
the pattern that strips the repeated label has to match it.

Also moves `buildSearchEntries`'s doc comment back onto
`buildSearchEntries`; it had ended up stacked above a helper.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-08-16 21:35:31 +02:00
parent 03f5f5666a
commit 15cb142f97
6 changed files with 23 additions and 15 deletions
+7
View File
@@ -40,6 +40,7 @@ const TOP_LEVEL: Record<string, string[]> = {
reset: [],
start: [],
list: ['ls'],
tui: [],
web: [],
service: [],
users: [],
@@ -137,6 +138,10 @@ describe('registered options', () => {
expect(flagsOf(find(program, 'doctor')!)).toEqual(expect.arrayContaining(['--json', '--category']));
});
it('keeps the two `tui` fast paths, which stand in for `sc -l` and `sc 2`', () => {
expect(flagsOf(find(program, 'tui')!)).toEqual(expect.arrayContaining(['-l', '--list']));
});
it('keeps the escape hatches that scripts depend on', () => {
expect(flagsOf(find(program, 'reset')!)).toEqual(expect.arrayContaining(['-f', '--force']));
expect(flagsOf(find(program, 'status')!)).toEqual(expect.arrayContaining(['--url']));
@@ -164,6 +169,8 @@ describe('registered arguments', () => {
it.each([
['attach', ['path']],
['start', []],
// Optional: bare `codeman tui` opens the dashboard.
['tui', ['n']],
])('declares the operands of `%s`', (name, expected) => {
const args = find(program, name)!.registeredArguments.map((arg) => arg.name());
expect(args).toEqual(expected);
+1 -1
View File
@@ -75,7 +75,7 @@ describe('formatAwayDigest', () => {
{ now: NOW }
);
expect(lines).toContain('NEEDS ATTENTION (1)');
expect(lines).toContain(' 2m w4-api permission prompt — Bash(git push)');
expect(lines).toContain(' 2m w4-api permission prompt · Bash(git push)');
});
it('caps a long section instead of burying the next one', () => {