ic-query-cli 0.83.0

Command-line wrapper for read-only Internet Computer metadata queries
Documentation
//! Parse bounded SNS metrics requests at the CLI boundary.

use crate::{
    cli::{clap::required_typed, common::OutputFormat},
    sns::commands::options::lookup_request,
};
use clap::ArgMatches;
use ic_query::sns::SnsMetricsRequest;

pub(in crate::sns::commands) fn metrics_request(
    matches: &ArgMatches,
    network: &str,
    now_unix_secs: u64,
) -> (OutputFormat, SnsMetricsRequest) {
    let (format, lookup) = lookup_request(matches, network, now_unix_secs);
    (
        format,
        SnsMetricsRequest::new(lookup).with_time_window_seconds(required_typed(matches, "window")),
    )
}