use crate::cli::clap::with_source_options;
use crate::cli::common::{COLLECTION_MODE_LIVE, collection_help};
use clap::Command as ClapCommand;
use ic_query::nns::registry::DEFAULT_NNS_REGISTRY_SOURCE_ENDPOINT;
const REGISTRY_VERSION_HELP_AFTER: &str = "\
Examples:
icq nns registry version
icq --network ic nns registry version --json
icq nns registry version --source-endpoint https://icp-api.io";
pub(in crate::nns) fn registry_command() -> ClapCommand {
ClapCommand::new("registry")
.about("Inspect NNS registry metadata")
.subcommand(registry_version_command())
}
pub(in crate::nns) fn registry_version_command() -> ClapCommand {
with_source_options::<crate::cli::common::SourceOutputOptions>(
ClapCommand::new("version")
.about("Show the certified latest mainnet NNS registry version")
.after_help(collection_help(
COLLECTION_MODE_LIVE,
REGISTRY_VERSION_HELP_AFTER,
)),
DEFAULT_NNS_REGISTRY_SOURCE_ENDPOINT,
"IC API endpoint used for the certified NNS registry query",
)
}