diff options
Diffstat (limited to 'crates/rocie-cli/src/cli.rs')
| -rw-r--r-- | crates/rocie-cli/src/cli.rs | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/crates/rocie-cli/src/cli.rs b/crates/rocie-cli/src/cli.rs new file mode 100644 index 0000000..ac220d5 --- /dev/null +++ b/crates/rocie-cli/src/cli.rs @@ -0,0 +1,63 @@ +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<String>, + + /// Optional parent of the new the product + #[arg(short, long)] + parent: Option<Uuid>, + }, + + 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 {}, +} |
