mirror of
https://git.yoctoproject.org/poky
synced 2026-09-24 13:36:22 +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:
committed by
Richard Purdie
parent
74b44e59be
commit
9a69da4489
@@ -501,6 +501,9 @@ subcommands = {
|
|||||||
def init_parser(parser):
|
def init_parser(parser):
|
||||||
parser.add_argument("--version", action="version",
|
parser.add_argument("--version", action="version",
|
||||||
version="%(prog)s {version}".format(version=__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)
|
subparsers = parser.add_subparsers(dest='command', help=hlp.wic_usage)
|
||||||
for subcmd in subcommands:
|
for subcmd in subcommands:
|
||||||
subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][2])
|
subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][2])
|
||||||
@@ -514,6 +517,8 @@ def main(argv):
|
|||||||
init_parser(parser)
|
init_parser(parser)
|
||||||
|
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
|
if args.debug:
|
||||||
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
if "command" in vars(args):
|
if "command" in vars(args):
|
||||||
if args.command == "help":
|
if args.command == "help":
|
||||||
|
|||||||
Reference in New Issue
Block a user