summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2019-12-15 22:38:34 +0900
committerRy Dahl <ry@tinyclouds.org>2019-12-15 21:38:34 +0800
commit3115781e4316653ab3619e3d94bdbce01fca4ec2 (patch)
treeb44617ad1d578821692faa12a8b3606ce3819c76
parente1eb458cad8caf5a0f08ad1d44caba7d557daf92 (diff)
feat: show detailed version with --version (#3507)
-rw-r--r--cli/flags.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index 824670a2a..edfb04dcf 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -123,6 +123,15 @@ The default subcommand is 'run'. The above is equivalent to
See 'deno help run' for run specific flags.";
+lazy_static! {
+ static ref LONG_VERSION: String = format!(
+ "{}\nv8 {}\ntypescript {}",
+ crate::version::DENO,
+ crate::version::v8(),
+ crate::version::TYPESCRIPT
+ );
+}
+
/// Main entry point for parsing deno's command line flags.
/// Exits the process on error.
pub fn flags_from_vec(args: Vec<String>) -> DenoFlags {
@@ -193,8 +202,8 @@ fn clap_root<'a, 'b>() -> App<'a, 'b> {
// Disable clap's auto-detection of terminal width
.set_term_width(0)
// Disable each subcommand having its own version.
- // TODO(ry) use long_version here instead to display TS/V8 versions too.
.version(crate::version::DENO)
+ .long_version(LONG_VERSION.as_str())
.arg(
Arg::with_name("log-level")
.short("L")