holmgr / cargo-sweep

A cargo subcommand for cleaning up unused build files generated by Cargo
MIT License
694 stars 31 forks source link

Migrate to clap 4 #87

Closed marcospb19 closed 1 year ago

marcospb19 commented 1 year ago

This PR migrates from clap 2 to clap 4, and does a little bit of refactoring on the code that it touches.

Fixes #86.

It also adds -m as a short flag for --maxsize.

jyn514 commented 1 year ago

Ah, I missed the last two commits - I would prefer to put those in a follow-up PR if possible, the clap migration is already quite large.

marcospb19 commented 1 year ago

I'll be separating the last two commits for the next PR. :+1:

marcospb19 commented 1 year ago

This is amazing! Thank you for putting the move from main.rs to cli.rs in its own commit! It made this much easier to review :)

I wanted to do it in even smaller pieces, but the migration commit had to do a lot of stuff at the same time.

I unindented most of the main function by one level, the diff is terribly unreadable because of it, so here's a tip, if you disable whitespace diffing:

image

You'll have 60 fewer modifications to review in that commit :wink:.