34 lines
671 B
Rust
34 lines
671 B
Rust
use clap::{Args, Parser, Subcommand, ValueEnum};
|
|
|
|
/// Program to read and set PiSugar configuration.
|
|
#[derive(Parser, Debug)]
|
|
#[command(author, version, about, long_about = None)]
|
|
struct Cli {
|
|
/// The command to run.
|
|
#[command(subcommand)]
|
|
command: Commands,
|
|
|
|
/// The model of your PiSugar. Defaults to pi-sugar3
|
|
#[arg(short, long, required = false)]
|
|
model: Models,
|
|
}
|
|
|
|
#[derive(Subcommand, Debug)]
|
|
enum Commands {
|
|
/// Read and display the current PiSugar configuration.
|
|
Info,
|
|
}
|
|
|
|
#[derive(ValueEnum, Debug, Clone, Default)]
|
|
enum Models {
|
|
#[default]
|
|
PiSugar3,
|
|
PiSugar2Pro,
|
|
PiSugar2_2led,
|
|
PiSugar2_4led,
|
|
}
|
|
|
|
fn main() {
|
|
let args = Cli::parse();
|
|
}
|