Skip to content

Commit fcb76c5

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents 51cf85b + b8298c7 commit fcb76c5

File tree

1 file changed

+4
-53
lines changed

1 file changed

+4
-53
lines changed

source/ada/lsp-ada_driver.adb

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ with VSS.Application;
3333
with VSS.Command_Line;
3434
with VSS.Standard_Paths;
3535
with VSS.Strings.Conversions;
36-
with VSS.Text_Streams.Standards;
3736

3837
with GNATCOLL.JSON;
3938
with GNATCOLL.Memory; use GNATCOLL.Memory;
@@ -83,9 +82,6 @@ procedure LSP.Ada_Driver is
8382
-- Quit the process when an uncaught exception reaches this. Used for
8483
-- fuzzing.
8584

86-
procedure Print_Help (Option : VSS.Command_Line.Named_Option'Class);
87-
-- Put option description to stdout
88-
8985
Server_Trace : constant Trace_Handle := Create ("ALS.MAIN", From_Config);
9086
-- Main trace for the LSP.
9187

@@ -138,31 +134,6 @@ procedure LSP.Ada_Driver is
138134
GNAT.OS_Lib.OS_Exit (42);
139135
end Die_On_Uncaught;
140136

141-
----------------
142-
-- Print_Help --
143-
----------------
144-
145-
procedure Print_Help (Option : VSS.Command_Line.Named_Option'Class) is
146-
use type VSS.Strings.Character_Count;
147-
Ok : Boolean := True;
148-
Output : VSS.Text_Streams.Output_Text_Stream'Class :=
149-
VSS.Text_Streams.Standards.Standard_Output;
150-
Last : VSS.Strings.Character_Count :=
151-
3 + Option.Long_Name.Character_Length;
152-
begin
153-
Output.Put (" --", Ok);
154-
Output.Put (Option.Long_Name, Ok);
155-
if Option in VSS.Command_Line.Value_Option'Class then
156-
Output.Put ("=ARG", Ok);
157-
Last := Last + 4;
158-
end if;
159-
160-
for J in Last + 1 .. 17 loop
161-
Output.Put (' ', Ok);
162-
end loop;
163-
Output.Put_Line (Option.Description, Ok);
164-
end Print_Help;
165-
166137
-----------------------
167138
-- Register_Commands --
168139
-----------------------
@@ -256,41 +227,21 @@ procedure LSP.Ada_Driver is
256227
Long_Name => "version",
257228
Description => "Display the program version");
258229

259-
Help_Option : constant VSS.Command_Line.Binary_Option :=
260-
(Short_Name => "",
261-
Long_Name => "help",
262-
Description => "Display this help");
263-
264230
Config_File : Virtual_File;
265231

266232
Memory_Monitor_Enabled : Boolean;
267233
begin
268234
-- Handle the command line
269-
-- Help => "Command line interface for the Ada Language Server");
270235

271236
VSS.Command_Line.Add_Option (Trace_File_Option);
272237
VSS.Command_Line.Add_Option (Config_File_Option);
273238
VSS.Command_Line.Add_Option (Language_GPR_Option);
274239
VSS.Command_Line.Add_Option (Version_Option);
275-
VSS.Command_Line.Add_Option (Help_Option);
276-
VSS.Command_Line.Process; -- Will exit if errors
277-
278-
if VSS.Command_Line.Is_Specified (Help_Option) then
279-
Ada.Text_IO.Put_Line
280-
("Language Server Ada and SPARK.");
281-
-- TBD: Print list of options using VSS
282-
Ada.Text_IO.Put_Line
283-
("Usage: ada_language_server [switches] [arguments]");
284-
Ada.Text_IO.New_Line;
285-
286-
Print_Help (Trace_File_Option);
287-
Print_Help (Config_File_Option);
288-
Print_Help (Language_GPR_Option);
289-
Print_Help (Version_Option);
290-
Print_Help (Help_Option);
240+
VSS.Command_Line.Add_Help_Option;
291241

292-
GNAT.OS_Lib.OS_Exit (0);
293-
elsif VSS.Command_Line.Is_Specified (Version_Option) then
242+
VSS.Command_Line.Process; -- Will exit if errors or help requested.
243+
244+
if VSS.Command_Line.Is_Specified (Version_Option) then
294245
Ada.Text_IO.Put_Line ("ALS version: " & $VERSION);
295246
GNAT.OS_Lib.OS_Exit (0);
296247
end if;

0 commit comments

Comments
 (0)