diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-29 09:05:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-29 09:05:35 -0500 |
commit | 5478e605aef93cc384b709688cc68e3ed854a68b (patch) | |
tree | cae570fd14014cb9fbde7e383125a7b09a7ffc4c /components/servo | |
parent | 19cb3e99680427a7ae30dbbc11f550e35ecc4576 (diff) | |
parent | d76ffa8fd8b9311ef13eb477c55fc0b7dce753f5 (diff) | |
download | servo-5478e605aef93cc384b709688cc68e3ed854a68b.tar.gz servo-5478e605aef93cc384b709688cc68e3ed854a68b.zip |
Auto merge of #11262 - campaul:add_version_flag, r=Manishearth
Add `--version` flag
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy --faster` does not report any errors
- [X] These changes fix #11241 (github issue number if applicable).
Either:
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
Not 100% sure of a good way to test this, so I'm submitting as is for feedback. Manually testing it appears to work fine.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11262)
<!-- Reviewable:end -->
Diffstat (limited to 'components/servo')
-rw-r--r-- | components/servo/main.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/components/servo/main.rs b/components/servo/main.rs index bf4c0b14f4c..ca0eec17955 100644 --- a/components/servo/main.rs +++ b/components/servo/main.rs @@ -40,6 +40,7 @@ use servo::Browser; use servo::compositing::windowing::WindowEvent; use servo::util::opts::{self, ArgumentParsingResult}; use servo::util::panicking::initiate_panic_hook; +use std::process; use std::rc::Rc; pub mod platform { @@ -102,6 +103,11 @@ fn main() { return servo::run_content_process(token) } + if opts::get().is_printing_version { + println!("Servo {}{}", env!("CARGO_PKG_VERSION"), env!("GIT_INFO")); + process::exit(0); + } + let window = app::create_window(None); // Our wrapper around `Browser` that also implements some |