@@ -33,7 +33,6 @@ with VSS.Application;
33
33
with VSS.Command_Line ;
34
34
with VSS.Standard_Paths ;
35
35
with VSS.Strings.Conversions ;
36
- with VSS.Text_Streams.Standards ;
37
36
38
37
with GNATCOLL.JSON ;
39
38
with GNATCOLL.Memory ; use GNATCOLL.Memory;
@@ -83,9 +82,6 @@ procedure LSP.Ada_Driver is
83
82
-- Quit the process when an uncaught exception reaches this. Used for
84
83
-- fuzzing.
85
84
86
- procedure Print_Help (Option : VSS.Command_Line.Named_Option'Class);
87
- -- Put option description to stdout
88
-
89
85
Server_Trace : constant Trace_Handle := Create (" ALS.MAIN" , From_Config);
90
86
-- Main trace for the LSP.
91
87
@@ -138,31 +134,6 @@ procedure LSP.Ada_Driver is
138
134
GNAT.OS_Lib.OS_Exit (42 );
139
135
end Die_On_Uncaught ;
140
136
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
-
166
137
-- ---------------------
167
138
-- Register_Commands --
168
139
-- ---------------------
@@ -256,41 +227,21 @@ procedure LSP.Ada_Driver is
256
227
Long_Name => " version" ,
257
228
Description => " Display the program version" );
258
229
259
- Help_Option : constant VSS.Command_Line.Binary_Option :=
260
- (Short_Name => " " ,
261
- Long_Name => " help" ,
262
- Description => " Display this help" );
263
-
264
230
Config_File : Virtual_File;
265
231
266
232
Memory_Monitor_Enabled : Boolean;
267
233
begin
268
234
-- Handle the command line
269
- -- Help => "Command line interface for the Ada Language Server");
270
235
271
236
VSS.Command_Line.Add_Option (Trace_File_Option);
272
237
VSS.Command_Line.Add_Option (Config_File_Option);
273
238
VSS.Command_Line.Add_Option (Language_GPR_Option);
274
239
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;
291
241
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
294
245
Ada.Text_IO.Put_Line (" ALS version: " & $VERSION);
295
246
GNAT.OS_Lib.OS_Exit (0 );
296
247
end if ;
0 commit comments