From 61214a8add6949e768f3791bb5e568395da0cae0 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 7 Feb 2016 17:57:10 +0100 Subject: simul: exit with the right status for --has-feature. --- src/ghdldrv/ghdlsimul.adb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ghdldrv/ghdlsimul.adb b/src/ghdldrv/ghdlsimul.adb index ff64fcf17..c5e950836 100644 --- a/src/ghdldrv/ghdlsimul.adb +++ b/src/ghdldrv/ghdlsimul.adb @@ -45,6 +45,7 @@ with Grt.Vpi; pragma Unreferenced (Grt.Vpi); with Grt.Types; with Grt.Options; +with Grt.Errors; with Grtlink; package body Ghdlsimul is @@ -160,7 +161,7 @@ package body Ghdlsimul is when Decode_Option_Last => exit; when Decode_Option_Stop => - exit; + Grt.Options.Flag_No_Run := True; when Decode_Option_Ok => null; end case; @@ -170,8 +171,16 @@ package body Ghdlsimul is end loop; end Set_Run_Options; - procedure Run is + procedure Run + is + use Ada.Command_Line; begin + if Grt.Options.Flag_No_Run then + -- Some options like --has-feature set the exit status. + Set_Exit_Status (Exit_Status (Grt.Errors.Exit_Status)); + return; + end if; + Grtlink.Flag_String := Flags.Flag_String; Simulation.Simulation_Entity (Top_Conf); -- cgit v1.2.3