Blob Blame History Raw
From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 17 Aug 2018 10:18:59 +0200
Subject: [PATCH 6/7] Throw an error if -s is used without a crate

In the future we might want to be smarter and find the crate, but let's at least
not ignore the option completely.
---
 rust2rpm/__main__.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
index 8e6f6eb..f23ebbc 100644
--- a/rust2rpm/__main__.py
+++ b/rust2rpm/__main__.py
@@ -178,6 +178,9 @@ def make_diff_metadata(crate, version, patch=False, store=False):
         if crate.endswith(".crate"):
             cratef, crate, version = local_crate(crate, version)
         else:
+            if store:
+                raise ValueError('--store-crate can only be used for a crate')
+
             toml, crate, version = local_toml(crate, version)
             diff = make_patch(toml, enabled=patch, tmpfile=True)
             metadata = Metadata.from_file(toml)
-- 
2.19.1