tools: simplify on/off attribute printing
refs #4004
Change-Id: Idb666ff4dbeddc37f1cb10710ba3d75f7fe8bdb5
diff --git a/tools/nfdc/face-module.cpp b/tools/nfdc/face-module.cpp
index 93a6563..85673a8 100644
--- a/tools/nfdc/face-module.cpp
+++ b/tools/nfdc/face-module.cpp
@@ -509,8 +509,8 @@
void
FaceModule::printFaceParams(std::ostream& os, text::ItemAttributes& ia, const ControlParameters& resp)
{
- os << ia("reliability") << (resp.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED) ? "on" : "off")
- << ia("congestion-marking") << (resp.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED) ? "on" : "off");
+ os << ia("reliability") << text::OnOff{resp.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED)}
+ << ia("congestion-marking") << text::OnOff{resp.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED)};
if (resp.hasBaseCongestionMarkingInterval()) {
os << ia("congestion-marking-interval")
<< text::formatDuration<time::milliseconds>(resp.getBaseCongestionMarkingInterval());