pmt: add control for -l flag

This commit is contained in:
2025-09-04 21:35:16 +03:00
parent deab481fd7
commit 51ae72aba1

View File

@@ -75,7 +75,7 @@ static Helper::garbageCollector collector;
int Main(int argc, char **argv) { int Main(int argc, char **argv) {
try { try {
// try-catch start // try-catch start
Helper::LoggingProperties::setProgramName("pmt"); Helper::LoggingProperties::setProgramName(argv[0]);
collector.closeAfterProgress(pstdout); collector.closeAfterProgress(pstdout);
collector.closeAfterProgress(pstderr); collector.closeAfterProgress(pstderr);
@@ -145,6 +145,11 @@ int Main(int argc, char **argv) {
"directory with -S " "directory with -S "
"(--search-path)"); "(--search-path)");
if (Variables->onLogical) {
if (!Variables->PartMap->hasLogicalPartitions())
throw Error("This device doesn't contains logical partitions. But you used -l (--logical) flag.");
}
if (!Helper::hasSuperUser()) { if (!Helper::hasSuperUser()) {
if (!((FuncManager.isUsed("rebootFunction") && if (!((FuncManager.isUsed("rebootFunction") &&
Helper::hasAdbPermissions()) || Helper::hasAdbPermissions()) ||