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

support cargo --version --verbose, just as rustc does #3584

Closed
froydnj opened this issue Jan 23, 2017 · 4 comments
Closed

support cargo --version --verbose, just as rustc does #3584

froydnj opened this issue Jan 23, 2017 · 4 comments

Comments

@froydnj
Copy link
Contributor

froydnj commented Jan 23, 2017

When checking for rustc versions, we've found its --version --verbose output very useful:

froydnj@hawkeye:~$ rustc --version --verbose
rustc 1.14.0 (e8a012324 2016-12-16)
binary: rustc
commit-hash: e8a0123241f0d397d39cd18fcc4e5e7edde22730
commit-date: 2016-12-16
host: x86_64-unknown-linux-gnu
release: 1.14.0
LLVM version: 3.9

It would be splendid if cargo supported the same form of output (obviously deleting things like the LLVM version, but perhaps there are other pertinent things that could be output). The --version --verbose output is somewhat easier to parse if you want to get at things like exact version number without worrying to deeply about the form of your regexes, for instance. The consistency between the two tools is also welcome.

bors added a commit that referenced this issue Jan 29, 2017
implement `cargo --version --verbose`

As suggested in #3584.  This is a bit underwhelming, and I'm unsure if some of the complexity in froydnj/cargo@775c900 is really warranted, but this series gets the job done.  Sample output when building with `configure` and `make`:

```
froydnj@hawkeye:~/src/cargo.git$ target/x86_64-unknown-linux-gnu/release/cargo --version
cargo-0.17.0-dev (ae4a4d8 2017-01-27)
froydnj@hawkeye:~/src/cargo.git$ target/x86_64-unknown-linux-gnu/release/cargo --version --verbose
cargo-0.17.0-dev (ae4a4d8 2017-01-27)
release: 0.17.0
commit-hash: ae4a4d8fc55bf7eca3d974f953dc61729e4a40db
commit-date: 2017-01-27
```
@bors bors closed this as completed in 50e1c1a Jan 29, 2017
@glandium
Copy link
Contributor

So, one thing that is different between rustc --version --verbose and cargo --version --verbose is version numbers for nightlies:

$ rustc --version --verbose | sed -n '1p;/release/p'
rustc 1.17.0-nightly (956e2bcba 2017-02-12)
release: 1.17.0-nightly
$ cargo --version --verbose | sed -n '1p;/release/p'
cargo-0.18.0-nightly (6f1b860 2017-02-11)
release: 0.18.0

@froydnj
Copy link
Contributor Author

froydnj commented Feb 15, 2017

So, one thing that is different between rustc --version --verbose and cargo --version --verbose is version numbers for nightlies:

I think I accidentally changed this in 775c900.

@froydnj
Copy link
Contributor Author

froydnj commented Feb 15, 2017

@alexcrichton Do you think it's worth changing it back? It'd be a one-line change.

@alexcrichton
Copy link
Member

@froydnj ah yeah makes sense to me!

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

No branches or pull requests

3 participants