pmt: reformat code, etc.
This commit is contained in:
@@ -14,9 +14,10 @@ Copyright 2025 Yağız Zengin
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "functions.hpp"
|
||||
#include <PartitionManager/PartitionManager.hpp>
|
||||
|
||||
#include "functions.hpp"
|
||||
|
||||
#define SFUN "partitionSizeFunction"
|
||||
#define FUNCTION_CLASS partitionSizeFunction
|
||||
|
||||
@@ -26,11 +27,12 @@ INIT {
|
||||
<< "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.\nUse get-logicals as partition "
|
||||
"name for getting sizes of logical partitions.\n"
|
||||
"Use get-physical as partition name for getting sizes of "
|
||||
"physical partitions.");
|
||||
->footer(
|
||||
"Use get-all or getvar-all as partition name for getting "
|
||||
"sizes of all partitions.\nUse get-logicals as partition "
|
||||
"name for getting sizes of logical partitions.\n"
|
||||
"Use get-physical as partition name for getting sizes of "
|
||||
"physical partitions.");
|
||||
cmd->add_option("partition(s)", partitions, "Partition name(s).")
|
||||
->required()
|
||||
->delimiter(',');
|
||||
@@ -72,7 +74,8 @@ RUN {
|
||||
partition.data());
|
||||
}
|
||||
|
||||
if (onlySize) println("%d", Helper::convertTo(props.size, multiple));
|
||||
if (onlySize)
|
||||
println("%d", Helper::convertTo(props.size, multiple));
|
||||
else
|
||||
println("%s: %d%s", partition.data(),
|
||||
Helper::convertTo(props.size, multiple),
|
||||
@@ -87,7 +90,8 @@ RUN {
|
||||
PART_MAP.doForLogicalPartitions(func);
|
||||
else if (partitions.back() == "get-physicals")
|
||||
PART_MAP.doForPhysicalPartitions(func);
|
||||
else PART_MAP.doForPartitionList(partitions, func);
|
||||
else
|
||||
PART_MAP.doForPartitionList(partitions, func);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -95,4 +99,4 @@ RUN {
|
||||
IS_USED_COMMON_BODY
|
||||
|
||||
NAME { return SFUN; }
|
||||
} // namespace PartitionManager
|
||||
} // namespace PartitionManager
|
||||
|
||||
Reference in New Issue
Block a user