use clap::Args;
use super::AuthTarget;
use crate::clients::ClientKind;
#[derive(Clone, Debug, Args)]
pub struct ConfigureArgs {
#[arg(value_enum, required_unless_present = "all")]
pub client: Option<ClientKind>,
#[arg(long, conflicts_with = "client")]
pub all: bool,
#[arg(long)]
pub undo: bool,
#[command(flatten)]
pub target: AuthTarget,
#[arg(long, hide_env_values = true, conflicts_with = "token_stdin")]
pub token: Option<String>,
#[arg(long, conflicts_with = "token")]
pub token_stdin: bool,
#[arg(long, default_value_t = 8760)]
pub ttl_hours: i64,
}
impl ConfigureArgs {
#[must_use]
pub fn clients(&self) -> Vec<ClientKind> {
self.client
.map_or_else(|| ClientKind::ALL.to_vec(), |client| vec![client])
}
}