You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
733 B
30 lines
733 B
use crate::config::FnmConfig; |
|
use crate::remote_node_index; |
|
use snafu::{ResultExt, Snafu}; |
|
use structopt::StructOpt; |
|
|
|
#[derive(StructOpt, Debug)] |
|
pub struct LsRemote {} |
|
|
|
impl super::command::Command for LsRemote { |
|
type Error = Error; |
|
|
|
fn apply(self, config: &FnmConfig) -> Result<(), Self::Error> { |
|
let all_versions = remote_node_index::list(&config.node_dist_mirror).context(HttpError)?; |
|
|
|
for version in all_versions { |
|
print!("{}", version.version); |
|
if let Some(lts) = &version.lts { |
|
print!(" ({})", lts); |
|
} |
|
println!(); |
|
} |
|
|
|
Ok(()) |
|
} |
|
} |
|
|
|
#[derive(Debug, Snafu)] |
|
pub enum Error { |
|
HttpError { source: crate::http::Error }, |
|
}
|
|
|