From 2851e70ffac0e2074a8fc3111410e42c16999bb2 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 14 Sep 2015 21:25:01 +0200 Subject: grt: add --list-features, and --has-feature --- src/grt/grt-options.adb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/grt/grt-options.adb') diff --git a/src/grt/grt-options.adb b/src/grt/grt-options.adb index 446439f..a03b6be 100644 --- a/src/grt/grt-options.adb +++ b/src/grt/grt-options.adb @@ -162,6 +162,9 @@ package body Grt.Options is P (" --expect-failure invert exit status"); P (" --no-run do not simulate, only elaborate"); -- P (" --threads=N use N threads for simulation"); + P ("Additional features:"); + P (" --has-feature=X test presence of feature X"); + P (" --list-features display the list of features"); Grt.Hooks.Call_Help_Hooks; P ("trace options:"); P (" --disp-time disp time as simulation advances"); @@ -228,7 +231,17 @@ package body Grt.Options is Status := Decode_Option_Last; elsif Option = "--help" or else Option = "-h" then Help; - Status := Decode_Option_Help; + Status := Decode_Option_Stop; + elsif Option = "--list-features" then + Grt.Hooks.Display_Hooks_Desc; + Status := Decode_Option_Stop; + elsif Len > 14 and then Option (1 .. 14) = "--has-feature=" then + if Grt.Hooks.Has_Feature (Option (15 .. Len)) then + Grt.Errors.Exit_Status := 0; + else + Grt.Errors.Exit_Status := 1; + end if; + Status := Decode_Option_Stop; elsif Option = "--disp-time" then Disp_Time := True; elsif Option = "--trace-signals" then @@ -499,7 +512,7 @@ package body Grt.Options is when Decode_Option_Last => Last_Opt := I; exit; - when Decode_Option_Help => + when Decode_Option_Stop => Stop := True; when Decode_Option_Ok => null; -- cgit