Sort parameter output by name

This commit is contained in:
Uwe Seimet 2022-02-17 18:38:23 +01:00
parent 4964506456
commit 6be197739a

View File

@ -304,7 +304,10 @@ void RasctlDisplay::DisplayOperationInfo(const PbOperationInfo& operation_info)
}
cout << endl;
for (const auto& parameter : operation.second.parameters()) {
list<PbOperationParameter> sorted_parameters = { operation.second.parameters().begin(), operation.second.parameters().end() };
sorted_parameters.sort([](const auto& a, const auto& b) { return a.name() < b.name(); });
for (const auto& parameter : sorted_parameters) {
cout << " " << parameter.name() << ": "
<< (parameter.is_mandatory() ? "mandatory" : "optional");
if (!parameter.description().empty()) {