From 792ff3770d392e8c17563cd76420722194ee718d Mon Sep 17 00:00:00 2001
From: Mark Craig <mark.craig@forgerock.com>
Date: Tue, 13 Oct 2015 08:32:47 +0000
Subject: [PATCH] OPENDJ-2336 Fix punctuation for generated man page descriptions

---
 opendj-ldap-toolkit/src/main/resources/com/forgerock/opendj/ldap/tools/tools.properties |   17 ++++++++++-------
 opendj-cli/src/main/resources/templates/refEntry.ftl                                    |    2 +-
 opendj-cli/src/main/resources/templates/refSect1.ftl                                    |    4 ++--
 opendj-doc-maven-plugin/src/main/resources/templates/log-message-reference.ftl          |    2 +-
 opendj-cli/src/main/resources/com/forgerock/opendj/cli/cli.properties                   |    1 +
 opendj-cli/src/main/resources/templates/dscfgSubcommand.ftl                             |    4 ++--
 opendj-cli/src/main/resources/templates/optionsRefSect1.ftl                             |    2 +-
 opendj-cli/src/main/resources/templates/refSect2.ftl                                    |    4 ++--
 opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommandArgumentParser.java         |    2 ++
 9 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommandArgumentParser.java b/opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommandArgumentParser.java
index 6975f96..3423a51 100644
--- a/opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommandArgumentParser.java
+++ b/opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommandArgumentParser.java
@@ -1158,7 +1158,9 @@
 
         Map<String, Object> map = new HashMap<>();
         map.put("name", scriptName);
+        map.put("title", REF_TITLE_SUBCOMMANDS.get());
         map.put("info", getDocSubcommandsDescriptionSupplement());
+        map.put("intro", REF_INTRO_SUBCOMMANDS.get(scriptName));
         if (scriptName.equals("dsconfig")) {
             // Break dsconfig into multiple pages, so use only the list here.
             map.put("isItemizedList", true);
diff --git a/opendj-cli/src/main/resources/com/forgerock/opendj/cli/cli.properties b/opendj-cli/src/main/resources/com/forgerock/opendj/cli/cli.properties
index 9e5d522..4cf91db 100755
--- a/opendj-cli/src/main/resources/com/forgerock/opendj/cli/cli.properties
+++ b/opendj-cli/src/main/resources/com/forgerock/opendj/cli/cli.properties
@@ -976,6 +976,7 @@
 REF_INTRO_OPTIONS=The <command>%s</command> command takes the following options:
 REF_DEFAULT=Default: %s
 REF_TITLE_SUBCOMMANDS=Subcommands
+REF_INTRO_SUBCOMMANDS=The <command>%s</command> command supports the following subcommands:
 REF_PART_TITLE_SUBCOMMANDS=%s Subcommands Reference
 REF_PART_INTRO_SUBCOMMANDS=This section covers <command>%s</command> subcommands.
 REF_SHORT_DESC_UNINSTALL=remove OpenDJ directory server software
diff --git a/opendj-cli/src/main/resources/templates/dscfgSubcommand.ftl b/opendj-cli/src/main/resources/templates/dscfgSubcommand.ftl
index 15abe42..e6f73cc 100644
--- a/opendj-cli/src/main/resources/templates/dscfgSubcommand.ftl
+++ b/opendj-cli/src/main/resources/templates/dscfgSubcommand.ftl
@@ -62,7 +62,7 @@
   <title>${descTitle}</title>
 
   <para>
-   ${description}
+   ${description?ensure_ends_with(".")}
   </para>
 
   <#if info??>${info}</#if>
@@ -82,7 +82,7 @@
     <term><option>${option.synopsis?xml}</option></term>
     <listitem>
      <para>
-      ${option.description}
+      ${option.description?ensure_ends_with(".")}
      </para>
 
      <#if option.info??>
diff --git a/opendj-cli/src/main/resources/templates/optionsRefSect1.ftl b/opendj-cli/src/main/resources/templates/optionsRefSect1.ftl
index ee7a085..23bb099 100644
--- a/opendj-cli/src/main/resources/templates/optionsRefSect1.ftl
+++ b/opendj-cli/src/main/resources/templates/optionsRefSect1.ftl
@@ -44,7 +44,7 @@
         <term><option>${option.synopsis?xml}</option></term>
         <listitem>
           <para>
-            ${option.description}
+            ${option.description?ensure_ends_with(".")}
           </para>
 
           <#if option.default??>
diff --git a/opendj-cli/src/main/resources/templates/refEntry.ftl b/opendj-cli/src/main/resources/templates/refEntry.ftl
index 63f8325..b0c853f 100644
--- a/opendj-cli/src/main/resources/templates/refEntry.ftl
+++ b/opendj-cli/src/main/resources/templates/refEntry.ftl
@@ -87,7 +87,7 @@
    <title>${descTitle}</title>
 
    <para>
-     ${description}
+     ${description?ensure_ends_with(".")}
    </para>
 
    <#if info??>${info}</#if>
diff --git a/opendj-cli/src/main/resources/templates/refSect1.ftl b/opendj-cli/src/main/resources/templates/refSect1.ftl
index 1302f58..5538204 100644
--- a/opendj-cli/src/main/resources/templates/refSect1.ftl
+++ b/opendj-cli/src/main/resources/templates/refSect1.ftl
@@ -25,14 +25,14 @@
  #
  #-->
 <refsect1 xml:id="${name}-subcommands">
-  <title>Subcommands</title>
+  <title>${title}</title>
 
   <#if info??>
     ${info}
   </#if>
 
   <para>
-   The <command>${name}</command> utility supports the following subcommands.
+   ${intro}
   </para>
 
   <#if isItemizedList??><itemizedlist></#if>
diff --git a/opendj-cli/src/main/resources/templates/refSect2.ftl b/opendj-cli/src/main/resources/templates/refSect2.ftl
index 059aa49..69c0ebb 100644
--- a/opendj-cli/src/main/resources/templates/refSect2.ftl
+++ b/opendj-cli/src/main/resources/templates/refSect2.ftl
@@ -28,7 +28,7 @@
   <title>${name}</title>
 
   <para>
-   ${description}
+   ${description?ensure_ends_with(".")}
   </para>
 
   <#if info??>${info}</#if>
@@ -48,7 +48,7 @@
             <term><option>${option.synopsis?xml}</option></term>
             <listitem>
              <para>
-               ${option.description}
+               ${option.description?ensure_ends_with(".")}
              </para>
 
              <#if option.info??>
diff --git a/opendj-doc-maven-plugin/src/main/resources/templates/log-message-reference.ftl b/opendj-doc-maven-plugin/src/main/resources/templates/log-message-reference.ftl
index 69cceba..932b6fc 100644
--- a/opendj-doc-maven-plugin/src/main/resources/templates/log-message-reference.ftl
+++ b/opendj-doc-maven-plugin/src/main/resources/templates/log-message-reference.ftl
@@ -56,7 +56,7 @@
      </para>
 
      <para>
-      ${entry.message}
+      ${entry.message?ensure_ends_with(".")}
      </para>
     </listitem>
    </varlistentry>
diff --git a/opendj-ldap-toolkit/src/main/resources/com/forgerock/opendj/ldap/tools/tools.properties b/opendj-ldap-toolkit/src/main/resources/com/forgerock/opendj/ldap/tools/tools.properties
index 10ddee2..4e849e1 100755
--- a/opendj-ldap-toolkit/src/main/resources/com/forgerock/opendj/ldap/tools/tools.properties
+++ b/opendj-ldap-toolkit/src/main/resources/com/forgerock/opendj/ldap/tools/tools.properties
@@ -438,26 +438,28 @@
   search throughput and response time of a directory service using \
   user-defined searches.\n\n\
   Example:\n\n\ \ searchrate -p 1389 -D "cn=directory manager" -w password \\\n\
-  \ \ \ \ -F -c 4 -t 4 -b "dc=example,dc=com" -g "rand(0,2000)" "(uid=user.%%d)"
+  \ \ \ \ -F -c 4 -t 4 -b "dc=example,dc=com" -g "rand(0,2000)" "(uid=user.%%d)"\n\n\
+  Before trying the example, import 2000 randomly generated users
 INFO_ADDRATE_TOOL_DESCRIPTION=This utility can be used to measure \
   add and optionally delete throughput and response time of a directory server using \
   user-defined entries. \
   The {template-file-path} argument identifies a template file \
-  that has the same form as a template file for the makeldif command. \
-  For details, see makeldif.template.\n\
-  \nExamples:\n \  This example is adding entries and randomly deleting them while \
+  that has the same form as a template file for the makeldif command.\n\
+  \nExamples:\n \  This example adds entries and randomly deletes them while \
   the number of entries added is greater than 10,000: \n \
   addrate -p 1389 -f -c 10 -C random -s 10000 addrate.template \n \
   This example adds entries and starts to delete them in the same \
   order if their age is greater than a certain time: \n \
-  addrate -p 1389 -f -c 10 -C fifo -a 2 addrate.template
+  addrate -p 1389 -f -c 10 -C fifo -a 2 addrate.template\n\n\
+  For details about the template file, see makeldif.template
 INFO_SEARCHRATE_TOOL_DESCRIPTION_BASEDN=Base DN format string.
 INFO_MODRATE_TOOL_DESCRIPTION=This utility can be used to measure \
   modify throughput and response time of a directory service using \
   user-defined modifications.\n\n\
   Example:\n\n\ \ modrate -p 1389 -D "cn=directory manager" -w password \\\n\
   \ \ \ \ -F -c 4 -t 4 -b "uid=user.%%d,ou=people,dc=example,dc=com" \\\n\
-  \ \ \ \ -g "rand(0,2000)" -g "randstr(16)" 'description:%%2$s'
+  \ \ \ \ -g "rand(0,2000)" -g "randstr(16)" 'description:%%2$s'\n\n\
+  Before trying the example, import 2000 randomly generated users
 INFO_MODRATE_TOOL_DESCRIPTION_TARGETDN=Target entry DN format string
 INFO_AUTHRATE_TOOL_DESCRIPTION=This utility can be used to measure \
   bind throughput and response time of a directory service using \
@@ -469,7 +471,8 @@
   Example (bind only):\n\n\ \ authrate -p 1389 -D "uid=user.%%d,ou=people,dc=example,dc=com" \\\n\
   \ \ \ \  -w password -f -c 10 -g "rand(0,2000)"\n\n\
   Example (search then bind):\n\n\ \ authrate -p 1389 -D '%%2$s' -w password -f -c 10 \\\n\
-  \ \ \ \ -b "ou=people,dc=example,dc=com" -s one -g "rand(0,2000)" "(uid=user.%%d)"
+  \ \ \ \ -b "ou=people,dc=example,dc=com" -s one -g "rand(0,2000)" "(uid=user.%%d)"\n\n\
+  Before trying the example, import 2000 randomly generated users
 INFO_OUTPUT_LDIF_FILE_PLACEHOLDER={file}
 INFO_LDIFMODIFY_DESCRIPTION_OUTPUT_FILENAME=Write updated entries to %s \
  instead of stdout

--
Gitblit v1.10.0