Skip to content

Check file existence before prompting for passwords - #87

Open
ben-harack wants to merge 1 commit into
Narigo:mainfrom
ben-harack:check-file-existence-before-password-prompt
Open

ben-harack wants to merge 1 commit into
Narigo:mainfrom
ben-harack:check-file-existence-before-password-prompt

Conversation

@ben-harack

Copy link
Copy Markdown

Summary

Both passwords were prompted for before either input file's existence was checked, so a typo'd filename only surfaced after the user had already typed in (up to two) passwords.

This moves keyfile resolution up and checks INPUT-A, INPUT-B, and both keyfiles (if given) up front, exiting immediately with Error: file not found: <path> on the first missing path — before any password prompt runs.

Test plan

  • cargo build --release — clean, no new warnings
  • Missing input file: fails immediately with a clear error, no password prompt, exit code 1
  • Existing files still diff correctly (verified against the repo's own test/test.kdbx / test/test2.kdbx fixtures with --passwords demopass)

Previously both passwords were prompted for before either input file's
existence was checked, so a typo'd filename only surfaced after the
user had already typed in (up to two) passwords. Move the keyfile
resolution up and check input files and keyfiles up front, exiting
immediately on a missing path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CksYookbdZ5Dz8h3cmvT4A

This branch has not been deployed

No deployments
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.

1 participant