Skip to main content

twinleaf_tools/cli/
upgrade.rs

1use clap::{Args, ValueHint};
2use std::path::PathBuf;
3
4use crate::{parse_existing_file, TioOpts};
5
6#[derive(Args, Debug)]
7pub struct UpgradeCli {
8    #[command(flatten)]
9    pub tio: TioOpts,
10
11    /// Input firmware image path. Omit to download the latest published
12    /// firmware for the connected sensor's name and hardware revision.
13    #[arg(value_hint = ValueHint::FilePath, value_parser = parse_existing_file)]
14    pub firmware_path: Option<PathBuf>,
15
16    /// List all published firmware for the connected sensor and interactively
17    /// pick one to install (allows installing an older release).
18    #[arg(long, conflicts_with = "firmware_path")]
19    pub downgrade: bool,
20
21    /// Skip confirmation prompt
22    #[arg(short = 'y', long = "yes")]
23    pub yes: bool,
24}