diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-04-09 21:41:20 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-13 22:33:20 +0100 |
commit | 3a60a23141a55e4733e0f66c361c62b6e173d68f (patch) | |
tree | 85fe114accdc20cf830d13037a8ef8efe38a5b5d /scripts | |
parent | 7141e488092f9833e349ce95f856dd9e26aa0f7b (diff) | |
download | poky-3a60a23141a55e4733e0f66c361c62b6e173d68f.tar.gz |
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.
(From OE-Core rev: 8cb9ac3751424d429a38f6f80d733b289b6684ea)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/wic | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/wic b/scripts/wic index fd4a67892b..5bedd90f87 100755 --- a/scripts/wic +++ b/scripts/wic | |||
@@ -279,13 +279,13 @@ def start_logging(loglevel): | |||
279 | logging.basicConfig(filname='wic.log', filemode='w', level=loglevel) | 279 | logging.basicConfig(filname='wic.log', filemode='w', level=loglevel) |
280 | 280 | ||
281 | 281 | ||
282 | def main(): | 282 | def main(argv): |
283 | parser = optparse.OptionParser(version="wic version %s" % __version__, | 283 | parser = optparse.OptionParser(version="wic version %s" % __version__, |
284 | usage=wic_usage) | 284 | usage=wic_usage) |
285 | 285 | ||
286 | parser.disable_interspersed_args() | 286 | parser.disable_interspersed_args() |
287 | 287 | ||
288 | (options, args) = parser.parse_args() | 288 | (options, args) = parser.parse_args(argv) |
289 | 289 | ||
290 | if len(args): | 290 | if len(args): |
291 | if args[0] == "help": | 291 | if args[0] == "help": |
@@ -298,7 +298,7 @@ def main(): | |||
298 | 298 | ||
299 | if __name__ == "__main__": | 299 | if __name__ == "__main__": |
300 | try: | 300 | try: |
301 | ret = main() | 301 | ret = main(sys.argv[1:]) |
302 | except Exception: | 302 | except Exception: |
303 | ret = 1 | 303 | ret = 1 |
304 | import traceback | 304 | import traceback |