From 31a20af7a4ad6236d608aa805a09c06305ecf800 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Dunand?= <aurelien.dunand@smartjog.com>
Date: Thu, 28 Jul 2011 16:16:51 +0200
Subject: [PATCH] add command takes several images files in one time

---
 bin/is | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/is b/bin/is
index 0f19663..ce7cf9b 100755
--- a/bin/is
+++ b/bin/is
@@ -90,8 +90,9 @@ def c_add(parser, args):
     elif len(repoman) > 1:
         raise Exception("Please select only one repository")
     repo = repoman[0]
-    pkg = PackageImage(args.path)
-    repo.add(pkg, delete=not args.preserve)
+    for image in args.path:
+        pkg = PackageImage(image)
+        repo.add(pkg, delete=not args.preserve)
 
 def c_del(parser, args):
     '''
@@ -298,7 +299,7 @@ p_init.set_defaults(func=c_init)
 p_add =  subparsers.add_parser("add", help=c_add.__doc__.lower())
 p_add.add_argument('-p', "--preserve", action="store_true", default=False,
                    help="don't remove image after adding to database")
-p_add.add_argument("path")
+p_add.add_argument("path", nargs="+")
 p_add.set_defaults(func=c_add)
 
 # del command parser
-- 
GitLab