summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2019-04-30 14:57:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-07 10:12:53 +0100
commit9a69da44892c46849cfff1866c14022a6bcc1d72 (patch)
tree9769771c517bbd1bead96d4cba57aa3e9c84952d /scripts
parent74b44e59be89c738f702948f9e16e367c0ba43ba (diff)
downloadpoky-9a69da44892c46849cfff1866c14022a6bcc1d72.tar.gz
wic: add global debug option
Add a global --debug option to assist debugging. (From OE-Core rev: 4e23b22bdf7b0e1fd16c7e53b6a7232c9c92ce95) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/wic5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/wic b/scripts/wic
index a3c0f731d9..017ef99dda 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -501,6 +501,9 @@ subcommands = {
501def init_parser(parser): 501def init_parser(parser):
502 parser.add_argument("--version", action="version", 502 parser.add_argument("--version", action="version",
503 version="%(prog)s {version}".format(version=__version__)) 503 version="%(prog)s {version}".format(version=__version__))
504 parser.add_argument("-D", "--debug", dest="debug", action="store_true",
505 default=False, help="output debug information")
506
504 subparsers = parser.add_subparsers(dest='command', help=hlp.wic_usage) 507 subparsers = parser.add_subparsers(dest='command', help=hlp.wic_usage)
505 for subcmd in subcommands: 508 for subcmd in subcommands:
506 subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][2]) 509 subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][2])
@@ -514,6 +517,8 @@ def main(argv):
514 init_parser(parser) 517 init_parser(parser)
515 518
516 args = parser.parse_args(argv) 519 args = parser.parse_args(argv)
520 if args.debug:
521 logger.setLevel(logging.DEBUG)
517 522
518 if "command" in vars(args): 523 if "command" in vars(args):
519 if args.command == "help": 524 if args.command == "help":