Skip to content

check/diff: unclear error messages for multiple files, a directory, and empty inputs #19

Description

@nao1215

Three error-path UX issues found while writing atago E2E coverage. Each is a message-quality problem, not a crash; the exit codes are already correct.

1. check with two or more FILE arguments prints only usage, with no error line

omokage check one.md two.md   # stdout empty, exit 1, only the usage block

The zero-argument path says missing FILE; the too-many-arguments path (cmd/app.go default branch) calls flagSet.Usage() with no explanatory line, so the user cannot tell what was wrong. Expected: an explicit "check takes exactly one FILE" line, consistent with the rest of the tool.

2. check DIR leaks a raw Go error

omokage check ./corpus/   # "read ./corpus/: is a directory", exit 1

The train path has an IsDir branch; the check path passes the os.ReadFile error straight through. Expected: a formatted message like the URL/extension/missing-path messages (e.g. "check reads a single .md/.txt file; ./corpus/ is a directory — use train for directories").

3. diff of two empty files reports "Similarity: 100%" with a misleading feature message

: > e.md
omokage diff e.md e.md   # exit 0, Similarity 100%, diff line "no enabled features configured"

The real cause is that neither document has measurable text; the "no enabled features configured" fallback (internal/profile/profile.go) is wrong (features are enabled). Expected: a message that says the documents have no measurable content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions