Skip to content
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

Added the --all flag #91

Closed
wants to merge 0 commits into from
Closed

Conversation

Max-Weissman
Copy link
Contributor

Implemented the delete everything as --time 0.

src/cli.rs Outdated
@@ -78,6 +78,10 @@ pub struct Args {
#[arg(short, long, value_name = "DAYS")]
time: Option<u64>,

/// Remove everything
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be misleading, because cargo sweep doesn't remove everything as cargo clean does, but I can't come up with something short and better than this, opinions @jyn514?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Remove all versioned artifacts", maybe. The flag won't remove examples, the incremental directory, or various misc things created by proc-macros or build scripts.

Honestly given that I wonder if this flag still makes sense to add? I think people will expect it to behave differently than it does, maybe we should recommend find . -name target | xargs rm -r or something instead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flag won't remove examples, the incremental directory, or various misc things created by proc-macros or build scripts.

I think this is exposing a communication problem in the tool, and it's not just related to --all, from the README:

A cargo subcommand for cleaning up unused build files generated by Cargo.

From reading this alone, we can't infer that cargo-sweep can't clean all of this you just described, and that's relevant when using other flags too, like --installed, --time and --maxsize.

So it's not just a confusion about --all.

I think the right approach to this would be to clarify on README and the --help description what it can sweep.

We can describe what files are "sweepable" and the current capabilities of cargo-sweep, before the usage examples, with that properly communicated, I think that the --all behavior will be obvious to be expected.

Even after addressing this, we can still argue if the --all flag would be confusing, but I think it wouldn't.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that makes sense to me. @Max-Weissman do you mind making that change to the readme and help as part of this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I'll get started on that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jyn514
I read through the code and updated the readme to what I think cargo-sweep is doing. I didn't change the help because to give a longer description I'd have to specify which artifacts each tag is referring to which might be a bit wordy. But I can add that too if you want.

Copy link
Collaborator

@marcospb19 marcospb19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked with --verbose to see if some logs were misleading regarding --all using --time internally, but everything seems fine.

@marcospb19
Copy link
Collaborator

marcospb19 commented Sep 11, 2023

Noooooooooooo, I rebased your branch and it actually closed your PR.

@Max-Weissman are you able to re-open it?

@marcospb19 marcospb19 mentioned this pull request Oct 7, 2023
@marcospb19
Copy link
Collaborator

I reopened the PR at #122.

Sorry for my mistake, I wanted to push changes on your master back to your master branch.

However, there are two master branches and git chose the one, I wasn't expecting it.

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.

3 participants