about summary refs log tree commit diff stats
path: root/crates/rocie-cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rocie-cli/src')
-rw-r--r--crates/rocie-cli/src/cli.rs4
-rw-r--r--crates/rocie-cli/src/handle/mod.rs4
2 files changed, 6 insertions, 2 deletions
diff --git a/crates/rocie-cli/src/cli.rs b/crates/rocie-cli/src/cli.rs
index a84ab0e..a683306 100644
--- a/crates/rocie-cli/src/cli.rs
+++ b/crates/rocie-cli/src/cli.rs
@@ -109,6 +109,10 @@ pub(crate) enum BarcodeCommand {
         /// The numeric value of the barcode
         #[arg(short, long)]
         id: u32,
+
+        /// How often to buy this barcode
+        #[arg(short, long, default_value = "1")]
+        times: u16,
     },
 
     /// Consume an barcode
diff --git a/crates/rocie-cli/src/handle/mod.rs b/crates/rocie-cli/src/handle/mod.rs
index 101f56d..929c0ff 100644
--- a/crates/rocie-cli/src/handle/mod.rs
+++ b/crates/rocie-cli/src/handle/mod.rs
@@ -148,8 +148,8 @@ pub(crate) async fn product(config: &Configuration, command: ProductCommand) ->
 
 pub(crate) async fn barcode(config: &Configuration, command: BarcodeCommand) -> Result<()> {
     match command {
-        BarcodeCommand::Buy { id } => {
-            buy_barcode(config, BarcodeId { value: id }).await?;
+        BarcodeCommand::Buy { id, times } => {
+            buy_barcode(config, BarcodeId { value: id }, u32::from(times)).await?;
         }
         BarcodeCommand::Consume {
             id,