diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-11-26 06:39:15 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-12-11 07:25:09 +0100 |
commit | 51ff306adfd1728dfe371a5bb2e64051aadc3a7d (patch) | |
tree | b71b99004b627844b3c35df0f5c21658a530ee67 /src/ghdldrv | |
parent | 4fff959635de496261c74a8c06b794a034fcce98 (diff) | |
download | ghdl-51ff306adfd1728dfe371a5bb2e64051aadc3a7d.tar.gz ghdl-51ff306adfd1728dfe371a5bb2e64051aadc3a7d.tar.bz2 ghdl-51ff306adfd1728dfe371a5bb2e64051aadc3a7d.zip |
errorout: add set_program_name.
ghdlmain: use errorout.
Diffstat (limited to 'src/ghdldrv')
-rw-r--r-- | src/ghdldrv/ghdlmain.adb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ghdldrv/ghdlmain.adb b/src/ghdldrv/ghdlmain.adb index 8c4267602..2f1d37e8d 100644 --- a/src/ghdldrv/ghdlmain.adb +++ b/src/ghdldrv/ghdlmain.adb @@ -21,6 +21,7 @@ with Ada.Command_Line.Response_File; with Version; with Bug; with Options; +with Types; use Types; package body Ghdlmain is procedure Init (Cmd : in out Command_Type) @@ -239,22 +240,16 @@ package body Ghdlmain is -- Disp MSG on the standard output with the command name. procedure Error (Msg : String) is - use Ada.Command_Line; - use Ada.Text_IO; + use Errorout; begin - Put (Standard_Error, Command_Name); - Put (Standard_Error, ": "); - Put_Line (Standard_Error, Msg); + Report_Msg (Msgid_Error, Option, No_Location, Msg); end Error; procedure Warning (Msg : String) is - use Ada.Command_Line; - use Ada.Text_IO; + use Errorout; begin - Put (Standard_Error, Command_Name); - Put (Standard_Error, ":warning: "); - Put_Line (Standard_Error, Msg); + Report_Msg (Msgid_Warning, Option, No_Location, Msg); end Warning; procedure Main @@ -266,6 +261,9 @@ package body Ghdlmain is Arg_Index : Natural; First_Arg : Natural; begin + -- Set program name for error message. + Errorout.Set_Program_Name (Command_Name); + -- Handle case of no argument if Argument_Count = 0 then Error ("missing command, try " & Command_Name & " --help"); |