[m-rev.] for review: avoid duplicate copyright sections in mmc.1 manual page

Julien Fischer jfischer at opturion.com
Mon Sep 4 14:54:13 AEST 2023


For review by anyone.

With the existing make_manpage script and usage message for mprof, we end
with the copyright notice in the SYNOPSIS section of the mprof.1 man
page, which is presumably not intentional?

It seems somewhat unusual to include the copyright notice in output
of --help at all, so perhaps as an alternative we should just omit it
from there and only print it with --version?

------------------------------------------------------


Avoid duplicate copyright sections in mmc.1 manual page.

compiler/handle_options.m:
     Do not prefix the copyright section of the usage message
     with "Copyright:" since this causes the make_manpage script
     to include a section "COPYRIGHT" section.

doc/make_manpage:
     Skip over lines beginning with "Copyright" since the script
     generates a standard copright notice at the end of each
     manual page.

Julien.

diff --git a/compiler/handle_options.m b/compiler/handle_options.m
index b509b1c..54bb8e6 100644
--- a/compiler/handle_options.m
+++ b/compiler/handle_options.m
@@ -3154,7 +3154,7 @@ long_usage(ProgressStream, !IO) :-
      library.version(Version, Fullarch),
      Template =
          "Name: mmc -- Melbourne Mercury Compiler, version %s on %s\n" ++
-        "Copyright: Copyright (C) 1993-2012 The University of Melbourne\n" ++
+        "Copyright (C) 1993-2012 The University of Melbourne\n" ++
          "Copyright (C) 2013-2023 The Mercury team\n" ++
          "Usage: mmc [<options>] <arguments>\n" ++
          "Arguments:\n" ++
diff --git a/doc/make_manpage b/doc/make_manpage
index 6b01ead..82e1de0 100755
--- a/doc/make_manpage
+++ b/doc/make_manpage
@@ -186,7 +186,7 @@ name == "mprof_merge_runs" && section == "Usage" && /^\t\t./ {

      # Ensure Copyright messages start on new line.
      if (line ~ /^Copyright \(C\)/) {
-        new_para = 1
+        next
      }

      if (new_para) {



More information about the reviews mailing list