ic-query-cli 0.100.0

Command-line wrapper for read-only Internet Computer metadata queries
Documentation
use super::args::SubnetListOptions;
use crate::cli::clap::with_source_options;
use crate::cli::common::{COLLECTION_MODE_CACHE_REFRESH_MISSING_OR_INVALID, collection_help};
use clap::Command as ClapCommand;
use ic_query::subnet_catalog::DEFAULT_SUBNET_CATALOG_SOURCE_ENDPOINT;

const LIST_HELP_AFTER: &str = "\
Examples:
  icq nns subnet list
  icq nns subnet list --verbose
  icq --network ic nns subnet list --json
  icq nns subnet list --kind application --specialization fiduciary

Refresh stale cache:
  icq nns subnet refresh";

pub(in crate::nns) fn list_command() -> ClapCommand {
    with_source_options::<SubnetListOptions>(
        ClapCommand::new("list"),
        DEFAULT_SUBNET_CATALOG_SOURCE_ENDPOINT,
        "IC API endpoint used if the subnet catalog cache is missing or invalid",
    )
    .about("List cached mainnet IC subnets")
    .after_help(collection_help(
        COLLECTION_MODE_CACHE_REFRESH_MISSING_OR_INVALID,
        LIST_HELP_AFTER,
    ))
}