[bmap-tools] [PATCH 03/14] bmaptool: disallow simultaneous --bmap and --nobmap

Artem Bityutskiy dedekind1 at gmail.com
Thu Sep 19 06:35:16 EDT 2013


From: Artem Bityutskiy <artem.bityutskiy at intel.com>

Do not allow users to use --bmap and --nobmap at the same time since it makes
no sense.

Change-Id: I69e02c1e885f7877e6b6e1dd5218bab07f1c1f24
Signed-off-by: Artem Bityutskiy <artem.bityutskiy at intel.com>
---
 bmaptool | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bmaptool b/bmaptool
index 6f3534a..77fee1c 100755
--- a/bmaptool
+++ b/bmaptool
@@ -221,6 +221,11 @@ def open_files(args, log):
 
 def copy_command(args, log):
     """Copy an image to a block device or a regular file using bmap."""
+
+    if args.nobmap and args.bmap:
+        log.error("--nobmap and --bmap cannot be used together")
+        raise SystemExit(1)
+
     image_obj, dest_obj, bmap_obj, bmap_path, image_size, dest_is_blkdev = \
                                                    open_files(args, log)
     try:
-- 
1.8.1.4




More information about the Bmap-tools mailing list