pmt: reformat code

This commit is contained in:
2025-08-27 22:24:50 +03:00
parent 41336609fa
commit bfd3324558
8 changed files with 33 additions and 28 deletions

View File

@@ -28,8 +28,8 @@
namespace PartitionManager {
RUN_ASYNC(backupFunction)(const std::string &partitionName,
const std::string &outputName,
const uint64_t bufferSize) {
const std::string &outputName,
const uint64_t bufferSize) {
if (!Variables->PartMap->hasPartition(partitionName))
return {format("Couldn't find partition: %s", partitionName.data()), false};

View File

@@ -26,7 +26,7 @@ Copyright 2025 Yağız Zengin
namespace PartitionManager {
RUN_ASYNC(eraseFunction)(const std::string &partitionName,
const uint64_t bufferSize) {
const uint64_t bufferSize) {
if (!Variables->PartMap->hasPartition(partitionName))
return {format("Couldn't find partition: %s", partitionName.data()), false};

View File

@@ -26,8 +26,8 @@ Copyright 2025 Yağız Zengin
namespace PartitionManager {
RUN_ASYNC(flashFunction)(const std::string &partitionName,
const std::string &imageName,
const uint64_t bufferSize) {
const std::string &imageName,
const uint64_t bufferSize) {
if (!Helper::fileIsExists(imageName))
return {format("Couldn't find image file: %s", imageName.data()), false};
if (!Variables->PartMap->hasPartition(partitionName))

View File

@@ -32,9 +32,9 @@ INIT(partitionSizeFunction) {
<< "Initializing variables of partition size getter function."
<< std::endl;
cmd = _app.add_subcommand("sizeof", "Tell size(s) of input partition list")
->footer("Use get-all or getvar-all as partition name for getting "
"sizes of all "
"partitions.");
->footer("Use get-all or getvar-all as partition name for getting "
"sizes of all "
"partitions.");
cmd->add_option("partition(s)", partitions, "Partition name(s).")
->required()
->delimiter(',');

View File

@@ -25,14 +25,15 @@
#define RUN(cls) bool cls::run()
#define RUN_ASYNC(cls) pair cls::runAsync
#define IS_USED(cls) bool cls::isUsed() const
#define IS_USED_COMMON_BODY(cls) bool cls::isUsed() const { return cmd->parsed(); }
#define IS_USED_COMMON_BODY(cls) \
bool cls::isUsed() const { return cmd->parsed(); }
#define NAME(cls) const char *cls::name() const
#define COMMON_FUNCTION_BODY() \
CLI::App *cmd = nullptr; \
bool init(CLI::App &_app) override; \
bool run() override; \
[[nodiscard]] bool isUsed() const override; \
#define COMMON_FUNCTION_BODY() \
CLI::App *cmd = nullptr; \
bool init(CLI::App &_app) override; \
bool run() override; \
[[nodiscard]] bool isUsed() const override; \
[[nodiscard]] const char *name() const override
namespace PartitionManager {