From ee5199cc65c337cb17f0ba1f9f853e00e9bda17d Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Mon, 10 Dec 2018 22:40:53 +0100
Subject: [PATCH] STYLE: adjust manpage layouts

---
 bin/tools/foamCreateManpage               |  2 +-
 src/OpenFOAM/global/argList/argListHelp.C | 38 +++++++++--------------
 2 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/bin/tools/foamCreateManpage b/bin/tools/foamCreateManpage
index ed7ad21ff19..29e38fdb90c 100755
--- a/bin/tools/foamCreateManpage
+++ b/bin/tools/foamCreateManpage
@@ -129,7 +129,7 @@ process()
     if grep -F -q "SYNOPSIS" "$tmpFile" 2>/dev/null
     then
         cat "$tmpFile" | \
-            sed -e "${sedFilter:-p}" | "${gzipFilter:-cat}" \
+            sed -e "${sedFilter}" | "${gzipFilter:-cat}" \
             >| "$outFile${gzipFilter:+.gz}"
 
         echo "$outFile${gzipFilter:+.gz}" 1>&2
diff --git a/src/OpenFOAM/global/argList/argListHelp.C b/src/OpenFOAM/global/argList/argListHelp.C
index 4199e0eb5d7..35ced1a0ea1 100644
--- a/src/OpenFOAM/global/argList/argListHelp.C
+++ b/src/OpenFOAM/global/argList/argListHelp.C
@@ -40,7 +40,7 @@ static inline void printManFooter()
         << "Online documentation "
         << "https://www.openfoam.com/documentation/" << nl
         << ".SH COPYRIGHT" << nl
-        << "Copyright 2018 OpenCFD Ltd." << nl;
+        << "Copyright \\(co 2018 OpenCFD Ltd." << nl;
 }
 
 
@@ -162,12 +162,11 @@ void Foam::argList::printMan() const
 {
     // .TH "<APPLICATION>" 1 "OpenFOAM-<version>" "source" "category"
 
-    Info
-        << ".TH" << token::SPACE
-        // All uppercase and quoted
+    Info<< ".TH" << token::SPACE
+        // All uppercase (returns a Foam::string) and thus also quoted
         << stringOps::upper(executable_) << token::SPACE
-        << "\"1\"" << token::SPACE
-        << token::DQUOTE << "OpenFOAM-v" << OPENFOAM << token::DQUOTE
+        << 1 << token::SPACE
+        << token::DQUOTE << "OpenFOAM-v" << foamVersion::api << token::DQUOTE
         << token::SPACE
         << token::DQUOTE << "www.openfoam.com" << token::DQUOTE
         << token::SPACE
@@ -177,8 +176,7 @@ void Foam::argList::printMan() const
 
     // .SH NAME
     // <application> \- part of OpenFOAM (The Open Source CFD Toolbox).
-    Info
-        << ".SH \"NAME\"" << nl
+    Info<< ".SH \"NAME\"" << nl
         << executable_
         << " \\- part of \\fBOpenFOAM\\fR (The Open Source CFD Toolbox)."
         << nl;
@@ -187,8 +185,7 @@ void Foam::argList::printMan() const
     // .SH SYNOPSIS
     // .B command [OPTIONS] ...
 
-    Info
-        << ".SH \"SYNOPSIS\"" << nl
+    Info<< ".SH \"SYNOPSIS\"" << nl
         << "\\fB" << executable_ << "\\fR [\\fIOPTIONS\\fR]";
 
     if (validArgs.size())
@@ -217,10 +214,9 @@ void Foam::argList::printMan() const
 
     // .SH DESCRIPTION
     {
-        Info
-            << ".SH \"DESCRIPTION\"" << nl;
+        Info<< ".SH \"DESCRIPTION\"" << nl;
 
-        Info<< ".nf" << nl;
+        Info<< ".nf" << nl; // No fill lines
 
         if (notes.empty())
         {
@@ -228,7 +224,6 @@ void Foam::argList::printMan() const
         }
         else
         {
-            Info<< nl;
             for (const std::string& note : notes)
             {
                 if (note.empty())
@@ -241,13 +236,12 @@ void Foam::argList::printMan() const
                 }
             }
         }
-        Info<< ".fi" << nl;
+        Info<< ".fi" << nl; // Fill lines
     }
 
 
     // .SH "OPTIONS"
-    Info
-        << ".SH \"OPTIONS\"" << nl;
+    Info<< ".SH \"OPTIONS\"" << nl;
 
     for (const word& optName : validOptions.sortedToc())
     {
@@ -266,9 +260,8 @@ void Foam::argList::printMan() const
     printManOption("help-full", "Display full help and exit");
 
 
-    // .SH "ADVANCED OPTIONS"
-    Info
-        << ".SH \"ADVANCED OPTIONS\"" << nl;
+    // .SS "ADVANCED OPTIONS"
+    Info<< ".SS \"ADVANCED OPTIONS\"" << nl;
 
     for (const word& optName : validOptions.sortedToc())
     {
@@ -402,9 +395,8 @@ void Foam::argList::printManCompat() const
     }
 
 
-    // .SH "COMPATIBILITY OPTIONS"
-    Info
-        << ".SH \"COMPATIBILITY OPTIONS\"" << nl;
+    // .SS "COMPATIBILITY OPTIONS"
+    Info<< ".SS \"COMPATIBILITY OPTIONS\"" << nl;
 
     for (const word& k : argList::validOptionsCompat.sortedToc())
     {
-- 
GitLab