Skip to content

Error on file arguments that match nothing - #57

Open
MPV wants to merge 1 commit into
claude/nonzero-exitfrom
claude/error-missing-files
Open

Error on file arguments that match nothing#57
MPV wants to merge 1 commit into
claude/nonzero-exitfrom
claude/error-missing-files

Conversation

@MPV

@MPV MPV commented Jul 23, 2026

Copy link
Copy Markdown
Owner

What

Treat a file argument that resolves to zero files as an error naming that argument.

Why

filepath.Glob returns no matches and no error both for a glob that matches nothing and for a literal path that doesn't exist, so a typo'd filename was silently skipped:

$ kir typo.yaml
$                 # no output, exit 0

Behavior change

An argument matching nothing now errors, and Run reports it and exits non-zero, instead of it being quietly ignored.

Testing

TestFindFilesMissing; end-to-end, kir /tmp/nope.yaml now prints no such file or match for "..." and exits 1.

Stack

Second of the CLI stack, on the Run(...) int shape from #63. Base: claude/nonzero-exit (#55). Merge order: #55 → this.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC

filepath.Glob returns no matches and no error both for a glob that
matches nothing and for a literal path that does not exist, so a typo'd
filename was silently skipped: `kir typo.yaml` produced no output and
exited 0.

Treat an argument that resolves to zero files as an error naming that
argument; Run then reports it and exits non-zero.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC
@MPV
MPV force-pushed the claude/error-missing-files branch from 64ff278 to 9bb2ee4 Compare August 2, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants