diff options
Diffstat (limited to 'crates/rocie-cli/src/cli.rs')
| -rw-r--r-- | crates/rocie-cli/src/cli.rs | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/crates/rocie-cli/src/cli.rs b/crates/rocie-cli/src/cli.rs index ac220d5..3f2662b 100644 --- a/crates/rocie-cli/src/cli.rs +++ b/crates/rocie-cli/src/cli.rs @@ -14,21 +14,62 @@ pub(crate) enum Command { #[command(subcommand)] command: ProductCommand, }, + + /// Deal with products + Unit { + #[command(subcommand)] + command: UnitCommand, + }, +} + +#[derive(Subcommand)] +pub(crate) enum UnitCommand { + /// Register a new unit + Register { + /// The full singular name of the new unit + /// E.g.: 1 kilogram + #[arg(short = 's', long)] + full_name_singular: String, + + /// The full plural name of the new unit + /// E.g.: 5 kilograms + #[arg(short = 'p', long)] + full_name_plural: String, + + /// The short name of the new unit (short names have no plural) + /// E.g.: 1 kg or 5 kg + #[arg(short = 'n', long)] + short_name: String, + + /// Optional description of the new unit + #[arg(short, long)] + description: Option<String>, + }, + + /// Fetch an unit based on id + GetById { + /// The id of the unit + #[arg(short, long)] + id: Uuid, + }, + + /// List all available units + List {}, } #[derive(Subcommand)] pub(crate) enum ProductCommand { /// Register a new product Register { - /// The name of new the product + /// The name of the new product #[arg(short, long)] name: String, - /// Optional description of the new the product + /// Optional description of the new product #[arg(short, long)] description: Option<String>, - /// Optional parent of the new the product + /// Optional parent of the new product #[arg(short, long)] parent: Option<Uuid>, }, @@ -48,7 +89,7 @@ pub(crate) enum ProductCommand { /// The unit the amount value is in #[arg(short = 'u', long)] - amount_unit: String, + amount_unit_id: Uuid, }, /// Get a already registered product by id |
