From c34f0ae5f80c88a8a84abc20de2c080475b7b822 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 15 Jan 2024 10:47:26 +0400 Subject: [PATCH] Add subprogram to output non-error message and exit process. Improve documentation a bit. --- source/os/implementation/vss-command_line.adb | 28 ++++++++++++++++++- source/os/vss-command_line.ads | 19 ++++++++++--- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/source/os/implementation/vss-command_line.adb b/source/os/implementation/vss-command_line.adb index ba8585cc..61ec7ba6 100644 --- a/source/os/implementation/vss-command_line.adb +++ b/source/os/implementation/vss-command_line.adb @@ -1,5 +1,5 @@ -- --- Copyright (C) 2022-2023, AdaCore +-- Copyright (C) 2022-2024, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -- @@ -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 -- ----------------- diff --git a/source/os/vss-command_line.ads b/source/os/vss-command_line.ads index 1c41415e..df65e35d 100644 --- a/source/os/vss-command_line.ads +++ b/source/os/vss-command_line.ads @@ -1,5 +1,5 @@ -- --- Copyright (C) 2022-2023, AdaCore +-- Copyright (C) 2022-2024, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -- @@ -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