Cargo-outdated a new subcommand for checking dep versions

NOTE: This is a cross post from the subreddit; I'm not sure how much cross pollination there is between these two places. If you've already seen this, please forgive me :wink:

Beef:
I've been playing with the idea of a cargo-outdated subcommand. So I put together a horribly hacky version...seriously the repo is a mess, not DRY at all, I just wanted it done, etc. But it works on my small tests.

If anyone wants to play with it, contribute, tear it apart, etc. Have at it!

For the interested, this current implementation simply uses tempdir and runs cargo update against it a few times (well it's a little more complicated than that...but that's the birds eye view). I'd love to hook into actual cargo for a more robust solution, but alas time is finite!

Here's the repo:

https://github.com/kbknapp/cargo-outdated

An example run would look something like this:

$ cargo outdated
The following dependencies have newer versions available:

Name             Project Ver  SemVer Compat  Latest Ver
clap                1.0.0        1.0.3         1.1.6
ansi_term           0.5.0        0.5.2         0.6.3
clap->ansi_term     0.5.0        0.6.3           --  

$ cargo outdated --root-deps-only
The following dependencies have newer versions available:

Name             Project Ver  SemVer Compat  Latest Ver
clap                1.0.0        1.0.3         1.1.6
ansi_term           0.5.0        0.5.2         0.6.3

$ cargo outdated -p clap
The following dependencies have newer versions available:

Name             Project Ver  SemVer Compat  Latest Ver
clap                1.0.0        1.0.3         1.1.6

There's a few more options, but you get the idea :wink: I've never run it against any large projects...so it may blow up - fair warning!

PS. You can see the calp->ansi_term SemVer/Latest bug in the above...but that's somewhat minor to me at the moment.

4 Likes