ic-query-cli 0.104.0

Command-line wrapper for read-only Internet Computer metadata queries
Documentation
mod info;
mod list;
mod refresh;

use crate::cli::clap::parsed_options;
use crate::nns::{NnsCommandError, subnet::commands::SubnetCommand};
use crate::storage::cache_root;
use clap::ArgMatches;
use ic_query::subnet_catalog::SubnetCatalogCacheRequest;
pub(in crate::nns) async fn run(
    matches: &ArgMatches,
    network: &str,
) -> Result<(), NnsCommandError> {
    match parsed_options::<SubnetCommand>(matches) {
        SubnetCommand::Status(options) => {
            crate::nns::operational_status::run(
                crate::nns::operational_status::OperationalStatusSubject::Subnet,
                options,
                network,
            )
            .await
        }
        SubnetCommand::List(options) => list::run_catalog_list(options, network).await,
        SubnetCommand::Info(options) => info::run_catalog_info(options, network).await,
        SubnetCommand::Refresh(options) => refresh::run_catalog_refresh(options, network).await,
    }
}

fn cache_request(network: &str) -> Result<SubnetCatalogCacheRequest, NnsCommandError> {
    Ok(SubnetCatalogCacheRequest::new(cache_root()?, network))
}