-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some enhancements to cargo clean
#12638
Commits on Sep 20, 2023
-
Wrap clean operations in a CleanContext.
This refactors some of the `cargo clean` code to wrap the "cleaning" operation in a `CleanContext` so that the context can be passed to other parts of cargo which can perform their own cleaning operations. There are some minor changes in the error messages to prepare for cleaning operations that aren't directly related to the build directory.
Configuration menu - View commit details
-
Copy full SHA for 61e8ef3 - Browse repository at this point
Copy the full SHA 61e8ef3View commit details -
Add a --dry-run option to
cargo clean
.This adds a `--dry-run` option to have `cargo clean` display what it would delete without actually deleting it.
Configuration menu - View commit details
-
Copy full SHA for 45c5394 - Browse repository at this point
Copy the full SHA 45c5394View commit details -
This adds a summary at the end when `cargo clean` finishes that displays how many files and bytes were removed.
Configuration menu - View commit details
-
Copy full SHA for 495ed7e - Browse repository at this point
Copy the full SHA 495ed7eView commit details -
Use existing arg_dry_run function.
And drop the `-n` short flag until we decide to commit to using it generally.
Configuration menu - View commit details
-
Copy full SHA for e7e354c - Browse repository at this point
Copy the full SHA e7e354cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9110aa - Browse repository at this point
Copy the full SHA e9110aaView commit details -
Separately track files and directories removed.
The previous status line was a little awkward in the way it combined both counts. I don't think showing the directories is particularly interesting, so they are only displayed when no files are deleted.
Configuration menu - View commit details
-
Copy full SHA for ebee726 - Browse repository at this point
Copy the full SHA ebee726View commit details -
Add a warning to
cargo clean --dry-run
This makes it more consistent with other `--dry-run` commands, and makes it clearer to the user that cargo did not do anything.
Configuration menu - View commit details
-
Copy full SHA for f61d42d - Browse repository at this point
Copy the full SHA f61d42dView commit details -
Don't display paths with
cargo clean --dry-run
without--verbose
The paths themselves aren't particularly interesting.
Configuration menu - View commit details
-
Copy full SHA for c204734 - Browse repository at this point
Copy the full SHA c204734View commit details -
Configuration menu - View commit details
-
Copy full SHA for 655f75d - Browse repository at this point
Copy the full SHA 655f75dView commit details