Skip to content

Scan the current directory for an explicit -p . instead of prompting [patch] - #169

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/explicit-dot-path
Oct 6, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/explicit-dot-path

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #145

Before: "." was both the default for --path and the marker that made each verb prompt, so Scan -p . asked for a path, and echo y | Deduplicate -p . read the y as the directory.

After: -p . scans the current directory without prompting. Leaving out -p still prompts.

How:

  • BaseVerb.PathString is now string? and defaults to null. BaseVerb<T>.Run resets it to null in its finally.
  • Scan, DryRun, Deduplicate and Stats prompt only when string.IsNullOrWhiteSpace(PathString).
  • ExplicitPathTests parses real command lines through Program.Verbs. It checks that -p . / --path . doesn't prompt in any of the four verbs, that Deduplicate --path . with y on stdin deletes the copy, and that leaving out -p still prompts. With the fix reverted, the four -p . tests fail.

Tests: 72 total, 70 passed, 2 skipped (the same two as on main, which need an unprivileged user).

🤖 Generated with Claude Code

https://claude.ai/code/session_01U5RBnMaTjZdMDRNttjeZ3u


Generated by Claude Code

…[patch]

"." was both the default for --path and the marker that made each verb ask
for one, so -p . prompted and read the next stdin line as the path. With
input piped in (echo y | Deduplicate -p .) the confirmation became the
directory. PathString is now null when the option is left out, verbs prompt
only when it is null or blank, and the run resets it to null.

Fixes #145

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5RBnMaTjZdMDRNttjeZ3u
@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit f060a21 into main Oct 6, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the fix/explicit-dot-path branch October 6, 2026 22:40
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.

Passing -p . explicitly is treated as "no path" and prompts, swallowing the next stdin line as the path

2 participants