]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use two-line format as pdnsutil does 16175/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 25 Sep 2025 07:34:17 +0000 (09:34 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 25 Sep 2025 11:12:10 +0000 (13:12 +0200)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/rec_channel_rec.cc

index 443ad2e35bf91573de47bd8027e3e308927c274e..d3c476b1226686ef96706a5e5502182d5dce7b27 100644 (file)
@@ -35,6 +35,7 @@
 #include "negcache.hh"
 #include <boost/format.hpp>
 #include <boost/algorithm/string.hpp>
+#include <iomanip>
 
 #include "version.hh"
 #include <sys/types.h>
@@ -1953,18 +1954,8 @@ static RecursorControlChannel::Answer help()
   };
   ostringstream str;
   for (const auto& command : commands) {
-    const size_t maxwidth = 32;
-    auto len = command.first.length();
-    if (len < maxwidth) {
-      str << command.first;
-      str << std::string(maxwidth - len, ' ');
-    }
-    else {
-      str << command.first << endl;
-      str << std::string(maxwidth, ' ');
-    }
-    str << command.second;
-    str << endl;
+    str << command.first << endl;
+    str << std::setw(8) << ' ' << command.second << endl;
   }
   return {0, str.str()};
 }