Use proper version string.

This commit is contained in:
Gav Wood
2016-02-21 20:00:45 +01:00
parent 75129613c5
commit 63bbd0ccd8
9 changed files with 21 additions and 9 deletions

View File

@@ -18,6 +18,8 @@
use std::fs::File;
use common::*;
use target_info::Target;
use rustc_version;
#[derive(Debug,Clone,PartialEq,Eq)]
/// Diff type for specifying a change (or not).
@@ -62,3 +64,8 @@ pub fn contents(name: &str) -> Result<Bytes, UtilError> {
try!(file.read_to_end(&mut ret));
Ok(ret)
}
/// Get the standard version string for this software.
pub fn version() -> String {
format!("Parity/-/{}/{}-{}-{}/{}", env!("CARGO_PKG_VERSION"), Target::arch(), Target::env(), Target::os(), rustc_version::version())
}