CVS difference for arm/progs/arm_form.ada

Differences between 1.20 and version 1.21
Log of other versions for file arm/progs/arm_form.ada

--- arm/progs/arm_form.ada	2012/12/14 04:15:03	1.20
+++ arm/progs/arm_form.ada	2016/04/21 03:14:27	1.21
@@ -17,7 +17,7 @@
     -- reference manual files (in various formats).
     --
     -- ---------------------------------------
-    -- Copyright 2000, 2002, 2004, 2005, 2006, 2011, 2012
+    -- Copyright 2000, 2002, 2004, 2005, 2006, 2011, 2012, 2016
     --   AXE Consultants. All rights reserved.
     -- P.O. Box 1512, Madison WI  53701
     -- E-Mail: randy@rrsoftware.com
@@ -75,52 +75,66 @@
     -- 10/19/11 - RLB - Removed junk withs (now in master file handler).
     --  4/ 3/12 - RLB - Removed dead variable.
     --  8/31/12 - RLB - Added output path parameter.
+    --  3/17/16 - RLB - Added lower version to command line.
 
     -- Standard commands for Ada standards:
     -- For Original (Ada 95) RM:
-    --	   Arm_Form RM <Format> No-Changes 0
+    --	   Arm_Form RM <Format> No-Changes 0 0
     -- For Original AARM:
-    --	   Arm_Form AARM <Format> No-Changes 0
+    --	   Arm_Form AARM <Format> No-Changes 0 0
     -- For RM with Corr:
     --     [With change bars for Word 97/2000:]
-    --	   Arm_Form RM RTF New-Changes 1
+    --	   Arm_Form RM RTF New-Changes 1 1
     --     [Final versions with no changes:]
-    --	   Arm_Form RM <Format> New-Only 1
+    --	   Arm_Form RM <Format> New-Only 1 1
     -- For AARM with Corr:
     --     [HTML; RTF for display]:
-    --	      Arm_Form AARM <Format> Show-Changes 1
+    --	      Arm_Form AARM <Format> Show-Changes 1 1
     --     [TXT; RTF for printing]:
-    --	      Arm_Form AARM <Format> New-Only 1
+    --	      Arm_Form AARM <Format> New-Only 1 1
     -- For RM with Corr and Amd:
     --     [With change bars for Word 97/2000:]
-    --	   Arm_Form RM RTF New-Changes 2
+    --	   Arm_Form RM RTF New-Changes 1 2
     --     [With change ballons for Word XP/2003:]
-    --	   Arm_Form RM RTF Show-Changes 2
+    --	   Arm_Form RM RTF Show-Changes 1 2
     --     [Final versions with no changes:]
-    --	   Arm_Form RM <Format> New-Only 2
+    --	   Arm_Form RM <Format> New-Only 1 2
     -- For AARM with Corr and Amd:
     --     [HTML; RTF for display]:
-    --	      Arm_Form AARM <Format> Changes-Only 2
+    --	      Arm_Form AARM <Format> Show-Changes 2 2
     --        (for only Amd changes) or
-    --	      Arm_Form AARM <Format> Show-Changes 2
+    --	      Arm_Form AARM <Format> Show-Changes 1 2
     --        (for all changes)
     --     [TXT; RTF for printing]:
-    --	      Arm_Form AARM <Format> New-Only 2
-    -- For Ada 2012 RM:
+    --	      Arm_Form AARM <Format> New-Only 2 2
+    -- For Ada 2012 RM: (To include TC1, change 3 to 4).
     --     [With change ballons for Word XP/2003:]
-    --	   Arm_Form RM RTF Show-Changes 3
+    --	   Arm_Form RM RTF Show-Changes 1 3
     --     [For change bar version for Word 97/2000:]
-    --	   Arm_Form RM RTF Changes-Only 3
+    --	   Arm_Form RM RTF Show-Changes 3 3
     --     [Final versions with no changes:]
-    --	   Arm_Form RM <Format> New-Only 3
-    -- For AARM with Corr and Amd:
+    --	   Arm_Form RM <Format> New-Only 3 3
+    -- For Ada 2012 AARM: (To include TC1, change 3 to 4).
     --     [HTML; RTF for display]:
-    --	      Arm_Form AARM <Format> Changes-Only 3
-    --        (for only Amda 2012 changes) or
-    --	      Arm_Form AARM <Format> Show-Changes 3
+    --	      Arm_Form AARM <Format> Show-Changes 3 3
+    --        (for only Amd 2012 changes) or
+    --	      Arm_Form AARM <Format>  Show-Changes 1 3
     --        (for all changes)
     --     [TXT; RTF for printing]:
-    --	      Arm_Form AARM <Format> New-Only 3
+    --	      Arm_Form AARM <Format> New-Only 1 3
+    -- For Ada 202x RM:
+    --     [For change bar version:]
+    --	   Arm_Form RM RTF Show-Changes 4 5
+    --     [Final versions with no changes:]
+    --	   Arm_Form RM <Format> New-Only 5 5
+    -- For Ada 202x AARM with:
+    --     [HTML; RTF for display]:
+    --	      Arm_Form AARM <Format> Show-Changes 4 5
+    --        (for only Amd 2012 changes) or
+    --	      Arm_Form AARM <Format>  Show-Changes 1 5
+    --        (for all changes)
+    --     [TXT; RTF for printing]:
+    --	      Arm_Form AARM <Format> New-Only 5 5
 
 
     No_Command_Error : exception;
@@ -128,19 +142,20 @@
     Format : ARM_Master.Output_Format_Type; -- Format to generate.
     Master_File : Ada.Strings.Unbounded.Unbounded_String; -- Master file for document to generate.
     Change_Kind : ARM_Format.Change_Kind; -- Changes to generate.
-    Change_Version : ARM_Contents.Change_Version_Type; -- Change version.
+    Base_Change_Version : ARM_Contents.Change_Version_Type; -- Lower Change version.
+    Change_Version : ARM_Contents.Change_Version_Type; -- (Upper) Change version.
     Output_Path : Ada.Strings.Unbounded.Unbounded_String; -- Output path.
 
     procedure Get_Commands is
 	-- Process the command line for this program.
     begin
-	if Ada.Command_Line.Argument_Count not in 1 .. 5 then
+	if Ada.Command_Line.Argument_Count not in 1 .. 6 then
 	    Ada.Text_IO.Put_Line ("** Wrong number of arguments");
 	    raise No_Command_Error;
 	end if;
-	if Ada.Command_Line.Argument_Count >= 5 then
+	if Ada.Command_Line.Argument_Count >= 6 then
 	    Output_Path := Ada.Strings.Unbounded.To_Unbounded_String(
-		    Ada.Strings.Fixed.Trim (Ada.Command_Line.Argument(5),
+		    Ada.Strings.Fixed.Trim (Ada.Command_Line.Argument(6),
 		       Ada.Strings.Right));
 	    -- Check that the Output_Path ends with a path separator.
 	    -- Note: This is a simple Windows check; it doesn't check for and
@@ -163,11 +178,11 @@
 	    Output_Path := Ada.Strings.Unbounded.To_Unbounded_String
 		("./output/"); -- Use '/' so this works on Linux and Windows.
 	end if;
-	if Ada.Command_Line.Argument_Count >= 4 then
+	if Ada.Command_Line.Argument_Count >= 5 then
 	    declare
 		Version_Arg : String :=
 		     Ada.Characters.Handling.To_Lower (
-			Ada.Strings.Fixed.Trim (Ada.Command_Line.Argument(4),
+			Ada.Strings.Fixed.Trim (Ada.Command_Line.Argument(5),
 			Ada.Strings.Right));
 	    begin
 		if Version_Arg'Length = 1 and then
@@ -181,6 +196,24 @@
 	else
 	    Change_Version := '0';
 	end if;
+	if Ada.Command_Line.Argument_Count >= 4 then
+	    declare
+		Version_Arg : String :=
+		     Ada.Characters.Handling.To_Lower (
+			Ada.Strings.Fixed.Trim (Ada.Command_Line.Argument(4),
+			Ada.Strings.Right));
+	    begin
+		if Version_Arg'Length = 1 and then
+		   Version_Arg(Version_Arg'First) in ARM_Contents.Change_Version_Type then
+		    Base_Change_Version := Version_Arg(Version_Arg'First);
+		else
+		    Ada.Text_IO.Put_Line ("** Unrecognized change version: " & Version_Arg);
+		    raise No_Command_Error;
+		end if;
+	    end;
+	else
+	    Base_Change_Version := '0';
+	end if;
 	if Ada.Command_Line.Argument_Count >= 3 then
 	    declare
 		Changes_Arg : String :=
@@ -192,8 +225,6 @@
 		    Change_Kind := ARM_Format.Old_Only;
 		elsif Changes_Arg = "new-only" then
 		    Change_Kind := ARM_Format.New_Only;
-		elsif Changes_Arg = "changes-only" then
-		    Change_Kind := ARM_Format.Changes_Only;
 		elsif Changes_Arg = "show-changes" then
 		    Change_Kind := ARM_Format.Show_Changes;
 		elsif Changes_Arg = "new-changes" then
@@ -244,22 +275,27 @@
         end;
     exception
 	when No_Command_Error =>
-	    Ada.Text_IO.Put_Line ("  Usage: Arm_Form <Master_File> [<Format>[ <Changes>[ <Version>[ <Output Path>]]]]}");
+	    Ada.Text_IO.Put_Line ("  Usage: Arm_Form <Master_File> [<Format>[ <Changes>[ <LowerVers>[ <UpperVers>[ <Output Path>]]]]]}");
 	    Ada.Text_IO.Put_Line ("     where: <Master_File> is the file name (and optional path) for the master file");
 	    Ada.Text_IO.Put_Line ("                        for the document;");
 	    Ada.Text_IO.Put_Line ("     where: <Format> = 'Text' (text files),");
 	    Ada.Text_IO.Put_Line ("                       'HTML' (HTML files),");
 	    Ada.Text_IO.Put_Line ("                       'RTF' (RTF files for Word 97 or later),");
 	    Ada.Text_IO.Put_Line ("                       'Corr' (Corrigendum-style command files for comparisons);");
-	    Ada.Text_IO.Put_Line ("     where: <Changes> = 'No-Changes' (RM text),");
-	    Ada.Text_IO.Put_Line ("                        'New-Only' (Revised RM text only for <Version>),");
-	    Ada.Text_IO.Put_Line ("                        'Changes-Only' (Text with changes marked for <Version> only),");
-	    Ada.Text_IO.Put_Line ("                        'Show-Changes' (Text with changes marked for <Version> and earlier),");
-	    Ada.Text_IO.Put_Line ("                        'New-Changes' (Text with insertions marked for <Version> and earlier);");
-	    Ada.Text_IO.Put_Line ("     where: <Version> = a value in 0 .. 9 representing the change version");
+	    Ada.Text_IO.Put_Line ("     where: <Changes> = 'No-Changes' (Original RM text),");
+	    Ada.Text_IO.Put_Line ("                        'New-Only' (Revised RM text only up to <ChgVers>),");
+	    Ada.Text_IO.Put_Line ("                        'Show-Changes' (Text with changes marked between");
+	    Ada.Text_IO.Put_Line ("                                        <BaseVers> and <ChgVers>),");
+	    Ada.Text_IO.Put_Line ("                        'New-Changes' (Text with insertions marked between");
+	    Ada.Text_IO.Put_Line ("                                        <BaseVers> and <ChgVers>);");
+	    Ada.Text_IO.Put_Line ("     where: <BaseVers> and <ChgVers> = a value in 0 .. 9 representing the");
+	    Ada.Text_IO.Put_Line ("                        base and primary change versions, respectively");
 	    Ada.Text_IO.Put_Line ("                        0-Original Ada 95 (equivalent to No-Changes)");
 	    Ada.Text_IO.Put_Line ("                        1-Technical Corrigendum 1");
 	    Ada.Text_IO.Put_Line ("                        2-Amendment 1");
+	    Ada.Text_IO.Put_Line ("                        3-Ada 2012");
+	    Ada.Text_IO.Put_Line ("                        4-Ada 2012 Technical Corrigendum 1");
+	    Ada.Text_IO.Put_Line ("                        5-Ada 202x");
 	    Ada.Text_IO.Put_Line ("     where: <Output_Path> = it the path where to write the result files. This must");
 	    Ada.Text_IO.Put_Line ("                        end with a path separator. It defaults to ./output/");
 	    raise No_Command_Error;
@@ -268,7 +304,7 @@
 
 begin
     Ada.Text_IO.Put_Line ("Ada Manual formatter");
-    Ada.Text_IO.Put_Line ("  Copyright 2000, 2002, 2004, 2005, 2006, 2011, 2012  AXE Consultants");
+    Ada.Text_IO.Put_Line ("  Copyright 2000, 2002, 2004, 2005, 2006, 2011, 2012, 2016  AXE Consultants");
     Ada.Text_IO.Put_Line ("  P.O. Box 1512, Madison WI  53701");
 
     Get_Commands;
@@ -282,6 +318,7 @@
 		File_Name => Ada.Strings.Unbounded.To_String(Master_File),
 		The_Change_Kind => Change_Kind,
 		The_Change_Version => Change_Version,
+		The_Base_Change_Version => Base_Change_Version,
 		Output_Format => Format,
 		Output_Path => Ada.Strings.Unbounded.To_String(Output_Path));
 

Questions? Ask the ACAA Technical Agent