diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-08-17 16:34:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 16:34:30 -0400 |
commit | 17b9c5c39028bce80e21d209c1283f8bac462bd9 (patch) | |
tree | 670113732364d1976a4b1b0e86f59512bfd3c551 /src/version.rs | |
parent | 4a55724f814a4f71b6275ce0f8a97f4720f39dea (diff) |
Command line flag parsing (#524)
In particular this allow -D for logging debug output.
Diffstat (limited to 'src/version.rs')
-rw-r--r-- | src/version.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/version.rs b/src/version.rs new file mode 100644 index 000000000..313b7dc9c --- /dev/null +++ b/src/version.rs @@ -0,0 +1,14 @@ +// Copyright 2018 the Deno authors. All rights reserved. MIT license. +use binding; +use std::ffi::CStr; + +// This is the source of truth for the Deno version. Ignore the value in Cargo.toml. +const DENO_VERSION: &str = "0.0.1"; + +pub fn print_version() { + let v = unsafe { binding::deno_v8_version() }; + let c_str = unsafe { CStr::from_ptr(v) }; + let version = c_str.to_str().unwrap(); + println!("deno: {}", DENO_VERSION); + println!("v8: {}", version); +} |