11-- ----------------------------------------------------------------------------
22-- GNAT Documentation Generation Tool --
33-- --
4- -- Copyright (C) 2022, AdaCore --
4+ -- Copyright (C) 2022-2023 , AdaCore --
55-- --
66-- This is free software; you can redistribute it and/or modify it under --
77-- terms of the GNU General Public License as published by the Free Soft- --
@@ -55,13 +55,19 @@ package body GNATdoc.Command_Line is
5555 Value_Name => " style" ,
5656 Description => " Use given style of documentation" );
5757
58+ Warnings_Option : constant VSS.Command_Line.Binary_Option :=
59+ (Short_Name => <>,
60+ Long_Name => " warnings" ,
61+ Description => " Report warnings for undocumented entities" );
62+
5863 Positional_Project_Option : constant VSS.Command_Line.Positional_Option :=
5964 (Name => " project_file" ,
6065 Description => " Project file to process" );
6166
6267 Output_Dir_Argument : GNATCOLL.VFS.Virtual_File;
6368 Project_File_Argument : VSS.Strings.Virtual_String;
6469 Project_Context_Arguments : GPR2.Context.Object;
70+ Warnings_Argument : Boolean := False;
6571
6672 -- --------------
6773 -- Initialize --
@@ -77,6 +83,7 @@ package body GNATdoc.Command_Line is
7783 VSS.Command_Line.Add_Option (Output_Dir_Option);
7884 VSS.Command_Line.Add_Option (Project_Option);
7985 VSS.Command_Line.Add_Option (Style_Option);
86+ VSS.Command_Line.Add_Option (Warnings_Option);
8087 VSS.Command_Line.Add_Option (Scenario_Option);
8188 VSS.Command_Line.Add_Option (Positional_Project_Option);
8289
@@ -168,6 +175,12 @@ package body GNATdoc.Command_Line is
168175 (VSS.Command_Line.Value (Output_Dir_Option))),
169176 GNATCOLL.VFS.Get_Current_Dir.Full_Name);
170177 end if ;
178+
179+ -- Process warnings command line switch.
180+
181+ if VSS.Command_Line.Is_Specified (Warnings_Option) then
182+ Warnings_Argument := True;
183+ end if ;
171184 end Initialize ;
172185
173186 -- --------------------
@@ -197,4 +210,13 @@ package body GNATdoc.Command_Line is
197210 return Project_File_Argument;
198211 end Project_File ;
199212
213+ -- ------------
214+ -- Warnings --
215+ -- ------------
216+
217+ function Warnings return Boolean is
218+ begin
219+ return Warnings_Argument;
220+ end Warnings ;
221+
200222end GNATdoc.Command_Line ;
0 commit comments