aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhcpl <hcpl@users.noreply.github.com>2017-11-12 03:17:47 +0200
committerJoe Wilm <jwilm@users.noreply.github.com>2017-11-11 17:17:47 -0800
commit8a09917dd1b51fee7a4f55fb79ff133822754304 (patch)
tree6229f5242ad35420e9242a09c27822840a8a923a /src
parentc5b689784ec0e039b092a6774e4a9496d8dc95b5 (diff)
downloadalacritty-8a09917dd1b51fee7a4f55fb79ff133822754304.tar.gz
alacritty-8a09917dd1b51fee7a4f55fb79ff133822754304.zip
Output more info for `--version` (#888)
Useful when requesting more info to help investigating issues.
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs10
-rw-r--r--src/lib.rs5
2 files changed, 15 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 04e83987..f1b27d26 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
extern crate log;
+use built_info;
use clap::{Arg, App};
use index::{Line, Column};
use config::{Dimensions, Shell};
@@ -20,6 +21,14 @@ use std::borrow::Cow;
const DEFAULT_TITLE: &'static str = "Alacritty";
+fn crate_long_version() -> String {
+ format!("{} (git commit {}) [{} build using {}])",
+ built_info::PKG_VERSION,
+ built_info::GIT_VERSION.unwrap_or(""),
+ built_info::PROFILE,
+ built_info::RUSTC_VERSION)
+}
+
/// Options specified on the command line
pub struct Options {
pub live_config_reload: Option<bool>,
@@ -56,6 +65,7 @@ impl Options {
let matches = App::new(crate_name!())
.version(crate_version!())
+ .long_version(crate_long_version().as_str())
.author(crate_authors!("\n"))
.about(crate_description!())
.arg(Arg::with_name("ref-test")
diff --git a/src/lib.rs b/src/lib.rs
index 255215c7..081259cd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -108,3 +108,8 @@ pub mod gl {
#![allow(non_upper_case_globals)]
include!(concat!(env!("OUT_DIR"), "/gl_bindings.rs"));
}
+
+#[allow(dead_code)]
+mod built_info {
+ include!(concat!(env!("OUT_DIR"), "/built.rs"));
+}