cli + query: improvements

This commit is contained in:
nym21
2025-03-02 20:15:01 +01:00
parent ceefc8ffc6
commit be2012f28d
15 changed files with 308 additions and 137 deletions

View File

@@ -5,14 +5,19 @@ use crate::{Format, Index};
#[derive(Debug, Deserialize, Parser)]
pub struct Params {
#[clap(short, long, value_parser = PossibleValuesParser::new(Index::ids()))]
#[clap(short, long, value_parser = PossibleValuesParser::new(Index::possible_values()))]
/// Index of the values requested
pub index: String,
#[clap(short, long, value_delimiter = ' ', num_args = 1..)]
/// Names of the values requested
pub values: Vec<String>,
#[clap(short, long, allow_hyphen_values = true)]
/// Inclusive starting index, if negative will be from the end
pub from: Option<i64>,
#[clap(short, long, allow_hyphen_values = true)]
/// Inclusive ending index, if negative will be from the end
pub to: Option<i64>,
#[clap(long)]
/// Format of the output
pub format: Option<Format>,
}