Repository navigation
Run the menu's verbs on the path given with -p instead of asking again [patch] - #184
Merged
Merged
Conversation
…n [patch] Menu is the default verb and inherits -p, so `FileDeduplicator -p dir` accepted the path, then every verb built by the menu prompted for it again. Each menu entry now hands the verb the menu's path before it runs, re-applied on every choice because BaseVerb<T>.Run clears it. Fixes #177 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019BwRbgKQMY5pZraxHBjxqM
|
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.



Fixes #177
Summary
Menuis the default verb and inherits-p, --pathfromBaseVerb, soFileDeduplicator -p ~/Photoswith no verb accepted the path. The verbs the menu then built never received it, so choosing Scan askedEnter the path to scan:again.The issue preferred keeping
-pworking over removing it, so this PR does that. Each menu entry, numbered or scrolling, is now a smallPresetPathCommandthat sets the verb'sPathStringfrom the menu's path just beforeExecute(). It is set again on every choice, becauseBaseVerb<T>.RunsetsPathStringback to null in itsfinally. The menu's ownPathStringstays set for the whole menu loop, since thatfinallyruns only after the loop exits. Without-p, the menu path is null, and each verb asks for a path as it did before.Tests
MenuHandsItsPathToTheChosenVerb: aMenuwithPathStringset picks Scan twice with no path on stdin. The test asserts there is noEnter the pathprompt and that both runs scan the given directory.🤖 Generated with Claude Code
https://claude.ai/code/session_019BwRbgKQMY5pZraxHBjxqM
Generated by Claude Code