colmena/src/command/nix_info.rs

17 lines
467 B
Rust
Raw Normal View History

2021-06-29 10:02:43 +02:00
use clap::{App, SubCommand, ArgMatches};
2021-11-18 22:15:20 +01:00
use crate::nix::{NixCheck, NixError};
2021-06-29 10:02:43 +02:00
pub fn subcommand() -> App<'static, 'static> {
SubCommand::with_name("nix-info")
.about("Show information about the current Nix installation")
}
2021-11-18 22:15:20 +01:00
pub async fn run(_global_args: &ArgMatches<'_>, _local_args: &ArgMatches<'_>) -> Result<(), NixError> {
2021-06-29 10:02:43 +02:00
let check = NixCheck::detect().await;
check.print_version_info();
check.print_flakes_info(false);
2021-11-18 22:15:20 +01:00
Ok(())
2021-06-29 10:02:43 +02:00
}