diff options
author | umarcor <unai.martinezcorral@ehu.eus> | 2021-01-05 17:08:54 +0100 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2021-01-05 21:02:21 +0100 |
commit | b4a301a37fc2b4f5515a7aa611c858ba6cba837f (patch) | |
tree | 6c9bb78d196e0a496b7610de678759a4ff0bfcd0 /src | |
parent | 0747980c3e8bf101abee2aad730f03da1411d318 (diff) | |
download | ghdl-b4a301a37fc2b4f5515a7aa611c858ba6cba837f.tar.gz ghdl-b4a301a37fc2b4f5515a7aa611c858ba6cba837f.tar.bz2 ghdl-b4a301a37fc2b4f5515a7aa611c858ba6cba837f.zip |
cli: add 'version ref' and 'version hash'
Diffstat (limited to 'src')
-rw-r--r-- | src/ghdldrv/ghdlmain.adb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ghdldrv/ghdlmain.adb b/src/ghdldrv/ghdlmain.adb index 2715e6f20..6d768bbbe 100644 --- a/src/ghdldrv/ghdlmain.adb +++ b/src/ghdldrv/ghdlmain.adb @@ -260,6 +260,19 @@ package body Ghdlmain is pragma Unreferenced (Cmd); use Simple_IO; begin + if Args'Length /= 0 then + if Args (1).all = "ref" then + Put_Line (Version.Ghdl_Ref); + return; + end if; + if Args (1).all = "hash" then + Put_Line (Version.Ghdl_Hash); + return; + end if; + Error ("warning: 'version' subcommand '" + & Args(1).all & "' not supported"); + return; + end if; Put ("GHDL "); Put (Version.Ghdl_Ver); Put (' '); @@ -278,9 +291,6 @@ package body Ghdlmain is & "GNU General Public License. There is NO"); Put_Line ("warranty; not even for MERCHANTABILITY or" & " FITNESS FOR A PARTICULAR PURPOSE."); - if Args'Length /= 0 then - Error ("warning: command '--version' does not accept any argument"); - end if; end Perform_Action; -- Disp MSG on the standard output with the command name. |