use clap::{Parser, Subcommand}; use uuid::Uuid; #[derive(Parser)] pub(crate) struct CliArgs { #[command(subcommand)] pub(crate) command: Command, } #[derive(Subcommand)] pub(crate) enum Command { /// Deal with products Product { #[command(subcommand)] command: ProductCommand, }, } #[derive(Subcommand)] pub(crate) enum ProductCommand { /// Register a new product Register { /// The name of new the product #[arg(short, long)] name: String, /// Optional description of the new the product #[arg(short, long)] description: Option, /// Optional parent of the new the product #[arg(short, long)] parent: Option, }, AssociateBarcode { /// The id of the product to associated the barcode with #[arg(short, long)] product_id: Uuid, /// The barcode number #[arg(short, long)] barcode_number: u32, /// The quantity of amount, this barcode signifies #[arg(short = 'v', long)] amount_value: u32, /// The unit the amount value is in #[arg(short = 'u', long)] amount_unit: String, }, /// Get a already registered product by id Get { /// The id of the product #[arg(short, long)] id: Uuid, }, /// List all available products List {}, }