nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

Status messages should be printed to stderr #154

Closed rosekunkel closed 3 years ago

rosekunkel commented 3 years ago

I would like to parse the output of cargo install-update -l. Unfortunately, there is no way to get just the list as output, without other output like

    Updating registry 'https://github.com/rust-lang/crates.io-index'

If these status messages were printed to stdout instead, it would be easy to separate them from the desired output. On a related note, cargo install-update -ql doesn't print anything. I would expect it to print just the list, since it was specifically requested with the -l flag.

nabijaczleweli commented 3 years ago

uh, sure there is:

nabijaczleweli@tarta:~$ cargo install-update -l | awk '/Package.*Installed.*Latest.*Needs update/,/^$/'
Package     Installed  Latest                               Needs update
cargo-deb   v1.27.0    v1.29.2                              Yes
checksums   v0.6.0     v0.7.1                               Yes
xargo       v0.3.22    v0.3.23                              Yes
cargo-tree  v0.29.0    v0.29.0                              No
pijul       v0.12.2    v0.12.2 (v1.0.0-alpha.48 available)  No
termimage   v1.1.0     v1.1.0                               No
treesize    v0.5.0     v0.5.0                               No

I'm quite sure you could massage this to whatever you want relatively easily.

As for the stream and -q behaviour: these match Cargo. And they aren't getting changed since that's an ABI break.