Skip to content

Commit

Permalink
Add hyperlinks to list command too
Browse files Browse the repository at this point in the history
  • Loading branch information
catuhana committed Jul 2, 2024
1 parent 6720819 commit 81145de
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/cli/list.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::Args;

use crate::types;
use crate::{exts::HyperlinkExt, types};

use super::NueCommand;

Expand Down Expand Up @@ -95,7 +95,7 @@ fn print_version_tree(releases: &[types::node::Release]) -> String {
"v{}{}\n",
release.version.major,
match &release.lts {
types::node::LTS::CodeName(code_name) => format!(" (LTS, {})", code_name),
types::node::LTS::CodeName(code_name) => format!(" ({} LTS)", code_name),
types::node::LTS::Bool(_false) => "".to_string(),
}
));
Expand All @@ -112,8 +112,11 @@ fn print_version_tree(releases: &[types::node::Release]) -> String {
}

tree_string.push_str(&format!(
" - v{}.{}.{}\n",
release.version.major, release.version.minor, release.version.patch
" - {}\n",
format!("v{}", release.version).hyperlink(format!(
"https://github.com/nodejs/node/releases/tag/v{}",
release.version
))
));
}

Expand Down

0 comments on commit 81145de

Please sign in to comment.