mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
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>
This commit is contained in:
parent
74b44e59be
commit
9a69da4489
|
@ -501,6 +501,9 @@ subcommands = {
|
|||
def init_parser(parser):
|
||||
parser.add_argument("--version", action="version",
|
||||
version="%(prog)s {version}".format(version=__version__))
|
||||
parser.add_argument("-D", "--debug", dest="debug", action="store_true",
|
||||
default=False, help="output debug information")
|
||||
|
||||
subparsers = parser.add_subparsers(dest='command', help=hlp.wic_usage)
|
||||
for subcmd in subcommands:
|
||||
subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][2])
|
||||
|
@ -514,6 +517,8 @@ def main(argv):
|
|||
init_parser(parser)
|
||||
|
||||
args = parser.parse_args(argv)
|
||||
if args.debug:
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
if "command" in vars(args):
|
||||
if args.command == "help":
|
||||
|
|
Loading…
Reference in New Issue
Block a user