Report error code on spawn

This commit is contained in:
alex@thor
2018-02-09 00:28:18 +01:00
parent 8fd52e008f
commit 11a2042b61
+11 -7
View File
@@ -101,15 +101,19 @@ package body Alire.OS_Lib is
end;
end loop;
declare
Line : constant String := Ada.Characters.Latin_1.CR & Simple_Command & " completed";
begin
Max_Len := Natural'Max (Max_Len, Simple_Command'length + 2); -- If there weren't any output
Put_Line (Line & String'(1 .. Max_Len - Line'Length => ' '));
end;
return Code : Integer do
Close (Pid, Code);
declare
Line : constant String :=
Ada.Characters.Latin_1.CR & Simple_Command &
(if Code = 0
then " completed"
else " ended with error (exit code" & Code'Img & ")");
begin
Max_Len := Natural'Max (Max_Len, Simple_Command'length + 2); -- If there weren't any output
Put_Line (Line & String'(1 .. Max_Len - Line'Length => ' '));
end;
end return;
end Spawn_With_Progress;