diff options
Diffstat (limited to 'src/grt')
-rw-r--r-- | src/grt/grt-options.adb | 38 | ||||
-rw-r--r-- | src/grt/grt-options.ads | 3 |
2 files changed, 25 insertions, 16 deletions
diff --git a/src/grt/grt-options.adb b/src/grt/grt-options.adb index d93ad9e58..e19d491ca 100644 --- a/src/grt/grt-options.adb +++ b/src/grt/grt-options.adb @@ -32,6 +32,26 @@ with Grt.Wave_Opt.File; package body Grt.Options is + procedure Set_Time_Resolution is + begin + case Flag_String (5) is + when 'f' | '-' => + Time_Resolution_Scale := 5; + when 'p' => + Time_Resolution_Scale := 4; + when 'n' => + Time_Resolution_Scale := 3; + when 'u' => + Time_Resolution_Scale := 2; + when 'm' => + Time_Resolution_Scale := 1; + when 's' => + Time_Resolution_Scale := 0; + when others => + Error ("unhandled time resolution"); + end case; + end Set_Time_Resolution; + procedure Help is use Grt.Astdio; @@ -384,22 +404,8 @@ package body Grt.Options is Len : Natural; Status : Decode_Option_Status; begin - case Flag_String (5) is - when 'f' | '-' => - Time_Resolution_Scale := 5; - when 'p' => - Time_Resolution_Scale := 4; - when 'n' => - Time_Resolution_Scale := 3; - when 'u' => - Time_Resolution_Scale := 2; - when 'm' => - Time_Resolution_Scale := 1; - when 's' => - Time_Resolution_Scale := 0; - when others => - Error ("unhandled time resolution"); - end case; + -- Must be done before decoding options. + Set_Time_Resolution; Stop := False; Last_Opt := Argc - 1; diff --git a/src/grt/grt-options.ads b/src/grt/grt-options.ads index fa7e1f660..32852d650 100644 --- a/src/grt/grt-options.ads +++ b/src/grt/grt-options.ads @@ -65,6 +65,9 @@ package Grt.Options is subtype Natural_Time_Scale is Natural range 0 .. 5; Time_Resolution_Scale : Natural_Time_Scale; + -- Set Time_Resolution_Scale from Flag_String. + procedure Set_Time_Resolution; + -- Display options help. -- Should not be called directly. procedure Help; |