/
rustwizard
/
pg_exporter
Обзор
Документация
Войти
/
rustwizard
/
pg_exporter
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/cli.rs
31 строка
1 KB
Rust Wizard
feat: add list-collectors command with min_pg_version info
14 май 2026, 16:04
Верифицирован
14 май 2026, 16:04
524fb29
Код
Авторство
О чём код?
use clap::{Parser, Subcommand}; use std::path::PathBuf; // PgExporter is a PostgreSQL Prometheus metrics exporter. #[derive(Parser, Debug)] #[command(name = "", version = concat!("PgExporter v", env!("GIT_HASH")))] pub struct Cli { /// Path to the configuration file. Default: "pg_exporter.yml" #[arg(short, long, default_value = "pg_exporter.yml")] pub config: PathBuf, /// Subcommand. #[command(subcommand)] pub command: Option<Commands>, } #[derive(Subcommand, Debug, Clone)] pub enum Commands { /// Start PgExporter. Run { /// Sets the host name or IP address(es) to listen to. #[arg(short, long)] listen_addr: Option<String>, /// Sets the HTTP endpoint(e.g. /metrics) that exposes monitoring data in a format Prometheus can scrape. Default: "/metrics" #[arg(short, long)] endpoint: Option<String>, }, /// Check configuration file for errors. Configcheck, /// List available collectors with their minimum PostgreSQL version. ListCollectors, }