diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-02-07 17:57:10 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-02-09 20:25:02 +0100 |
commit | 61214a8add6949e768f3791bb5e568395da0cae0 (patch) | |
tree | 0e4167f2207a47af37d55c21c4dc532778f58bdc /src | |
parent | 155ec09bdd13e11055d39e5a329dd6e3df38a514 (diff) | |
download | ghdl-61214a8add6949e768f3791bb5e568395da0cae0.tar.gz ghdl-61214a8add6949e768f3791bb5e568395da0cae0.tar.bz2 ghdl-61214a8add6949e768f3791bb5e568395da0cae0.zip |
simul: exit with the right status for --has-feature.
Diffstat (limited to 'src')
-rw-r--r-- | src/ghdldrv/ghdlsimul.adb | 13 |
1 files changed, 11 insertions, 2 deletions
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); |