feat: support multiple files in --file flag#53
Merged
pixincreate merged 2 commits intomasterfrom May 4, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates KeyWatch’s CLI and scan pipeline to accept multiple file targets through --file, aligning the scanner with issue #15’s request to scan more than one file in a single invocation.
Changes:
- Changes
CliOptions.filefrom a single optional path to a vector with comma-delimited parsing support. - Updates
run_scanto add all provided file paths to the scan target list. - Refreshes scanner/hook tests and adds a multi-file scan test.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/cli.rs |
Expands the --file CLI option to accept multiple values and comma-separated input. |
src/scanner.rs |
Switches scan target collection from a single file path to all provided file paths. |
tests/scanner_tests.rs |
Updates scanner tests for the new Vec<String> shape and adds a multi-file scan case. |
tests/hooks_tests.rs |
Adjusts hook tests to construct CliOptions with an empty file list. |
--file flag
fd80353 to
9079efe
Compare
- Allow multiple --file flags or comma-separated paths - Add test for multi-file scanning - Fix test code to use Vec<String> instead of Option<String> Closes #15
c1afb1d to
5b8547e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--fileflags or comma-separated paths in a single commandkey-watch --file a.txt --file b.txtorkey-watch --file a.txt,b.txtChanges
src/cli.rs: Changedfile: Option<String>tofile: Vec<String>withvalue_delimiter = ','src/scanner.rs: Updated to extend target_paths from the vec instead of single optiontests/scanner_tests.rs: Addedtest_multiple_files_scantestvec![]instead ofNoneCloses
Closes #15