aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-04-09 21:41:20 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-13 22:28:33 +0100
commit8cb9ac3751424d429a38f6f80d733b289b6684ea (patch)
treee695dceeffc8a86f145293393819a0d3a6efd6b5
parent7166262032648dbbc8b4b476c8770e35b1d4e234 (diff)
downloadopenembedded-core-contrib-8cb9ac3751424d429a38f6f80d733b289b6684ea.tar.gz
openembedded-core-contrib-8cb9ac3751424d429a38f6f80d733b289b6684ea.tar.bz2
openembedded-core-contrib-8cb9ac3751424d429a38f6f80d733b289b6684ea.zip
wic: Add argv argument to main
Make it possible to call wic as an API from tests passing command line parameters as arguments to main. This is yet another enabler for wic unit testing. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/wic6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/wic b/scripts/wic
index fd4a67892bf..5bedd90f874 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -279,13 +279,13 @@ def start_logging(loglevel):
logging.basicConfig(filname='wic.log', filemode='w', level=loglevel)
-def main():
+def main(argv):
parser = optparse.OptionParser(version="wic version %s" % __version__,
usage=wic_usage)
parser.disable_interspersed_args()
- (options, args) = parser.parse_args()
+ (options, args) = parser.parse_args(argv)
if len(args):
if args[0] == "help":
@@ -298,7 +298,7 @@ def main():
if __name__ == "__main__":
try:
- ret = main()
+ ret = main(sys.argv[1:])
except Exception:
ret = 1
import traceback