From 1714eaf29e7b63fec1728d5c03cbec366c0eba20 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 26 Oct 2014 13:41:00 +0100 Subject: [PATCH] pkgman resolve-dependencies: Add --debug option --- src/bin/pkgman/command_resolve_dependencies.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/bin/pkgman/command_resolve_dependencies.cpp b/src/bin/pkgman/command_resolve_dependencies.cpp index eb10867514..8ef44474ea 100644 --- a/src/bin/pkgman/command_resolve_dependencies.cpp +++ b/src/bin/pkgman/command_resolve_dependencies.cpp @@ -42,6 +42,11 @@ static const char* const kLongUsage = "Resolves and lists all packages the given packages depend on. Fails, if\n" "not all dependencies could be resolved.\n" "\n" + "Options:\n" + " --debug \n" + " Print debug output. should be between 0 (no debug output,\n" + " the default) and 10 (most debug output).\n" + "\n" "Arguments:\n" " \n" " The HPKG or package info file of the package for which the\n" @@ -114,6 +119,7 @@ ResolveDependenciesCommand::Execute(int argc, const char* const* argv) { while (true) { static struct option sLongOptions[] = { + { "debug", required_argument, 0, OPTION_DEBUG }, { "help", no_argument, 0, 'h' }, { 0, 0, 0, 0 } }; @@ -123,6 +129,9 @@ ResolveDependenciesCommand::Execute(int argc, const char* const* argv) if (c == -1) break; + if (fCommonOptions.HandleOption(c)) + continue; + switch (c) { case 'h': PrintUsageAndExit(false); @@ -161,6 +170,8 @@ ResolveDependenciesCommand::Execute(int argc, const char* const* argv) if (error != B_OK) DIE(error, "failed to create solver"); + solver->SetDebugLevel(fCommonOptions.DebugLevel()); + // add repositories BPackagePathMap packagePaths; BObjectList repositories(10, true);