Skip to content

Commit

Permalink
Merge branch 'topic/vadim/cmlline' into 'master'
Browse files Browse the repository at this point in the history
Add subprogram to output non-error message and exit process.

Closes #229

See merge request eng/ide/VSS!308
  • Loading branch information
godunko committed Jan 15, 2024
2 parents 893228a + c34f0ae commit 3b610a8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 5 deletions.
28 changes: 27 additions & 1 deletion source/os/implementation/vss-command_line.adb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright (C) 2022-2023, AdaCore
-- Copyright (C) 2022-2024, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
Expand Down Expand Up @@ -158,6 +158,32 @@ package body VSS.Command_Line is
GNAT.OS_Lib.OS_Exit (1);
end Report_Error;

--------------------
-- Report_Message --
--------------------

procedure Report_Message
(Message : VSS.Strings.Virtual_String) is
begin
Platform.Report_Message
(Message => Message,
Is_Error => False);
GNAT.OS_Lib.OS_Exit (0);
end Report_Message;

--------------------
-- Report_Message --
--------------------

procedure Report_Message
(Message : VSS.String_Vectors.Virtual_String_Vector) is
begin
Platform.Report_Message
(Message => Message,
Is_Error => False);
GNAT.OS_Lib.OS_Exit (0);
end Report_Message;

-----------------
-- Unique_Name --
-----------------
Expand Down
19 changes: 15 additions & 4 deletions source/os/vss-command_line.ads
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--
-- Copyright (C) 2022-2023, AdaCore
-- Copyright (C) 2022-2024, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
Expand Down Expand Up @@ -80,13 +80,24 @@ package VSS.Command_Line is
return VSS.String_Vectors.Virtual_String_Vector;
-- Return list of positional arguments.

procedure Report_Error (Message : VSS.Strings.Virtual_String)
procedure Report_Error
(Message : VSS.Strings.Virtual_String)
with No_Return;
-- Report error and terminate application.
-- Report error and terminate application with error status.

procedure Report_Error (Message : VSS.String_Vectors.Virtual_String_Vector)
with No_Return;
-- Report error and terminate application.
-- Report error and terminate application with error status.

procedure Report_Message
(Message : VSS.Strings.Virtual_String)
with No_Return;
-- Report message and terminate application with normal status.

procedure Report_Message
(Message : VSS.String_Vectors.Virtual_String_Vector)
with No_Return;
-- Report message and terminate application with normal status.

private

Expand Down

0 comments on commit 3b610a8

Please sign in to comment.