summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Utilities/man.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/Userland/Utilities/man.cpp b/Userland/Utilities/man.cpp
index abfbb9caf3..c56ff45c11 100644
--- a/Userland/Utilities/man.cpp
+++ b/Userland/Utilities/man.cpp
@@ -116,13 +116,21 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto buffer = file->read_all();
auto source = String::copy(buffer);
- outln("{}({})\t\tSerenityOS manual", name, section);
+ const String title("SerenityOS manual");
+
+ int spaces = view_width / 2 - String(name).length() - String(section).length() - title.length() / 2 - 4;
+ if (spaces < 0)
+ spaces = 0;
+ out("{}({})", name, section);
+ while (spaces--)
+ out(" ");
+ outln(title);
auto document = Markdown::Document::parse(source);
VERIFY(document);
String rendered = document->render_for_terminal(view_width);
- out("{}", rendered);
+ outln("{}", rendered);
// FIXME: Remove this wait, it shouldn't be necessary but Shell does not
// resume properly without it. This wait also breaks <C-z> backgrounding