forked from mcauley-penney/mmv-c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: explicitly handle unedited args
It is possible to pass args to mmv and subsequently not edit them in the editing buffer. Until now, avoiding working with these args was handled in various places, such as via checks in our rename function and in our cycle removal function. This commit adds a function which checks for such args and replaces their key in the set data structure with an invalid key so that they will not be looked at for cycle removal or renaming. For example, if the user does ``` mmv -v test1.txt test2.txt ``` but then does not edit `test2.txt` in the editing buffer, `test2.txt` will appear as the destination name for the `test2.txt` source arg, given that it was not edited. When the sets are subjected to this function, `test2.txt` will be found as a duplicate of its source argument and will be avoided in later operations.
- Loading branch information
1 parent
e8ee625
commit 69cc314
Showing
6 changed files
with
96 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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