diff options
-rw-r--r-- | src/ghdldrv/ghdlmain.adb | 16 | ||||
-rwxr-xr-x | testsuite/testsuite.sh | 12 |
2 files changed, 20 insertions, 8 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. diff --git a/testsuite/testsuite.sh b/testsuite/testsuite.sh index f62d9e577..651c82012 100755 --- a/testsuite/testsuite.sh +++ b/testsuite/testsuite.sh @@ -252,15 +252,17 @@ do_test() { esac } -for t in $tests; do do_test $t; done - -printf "${ANSI_GREEN}[GHDL - test] SUCCESSFUL${ANSI_NOCOLOR}\n" -touch test_ok - gstart "GHDL is: $GHDL" $GHDL version +echo "REF: `$GHDL version ref`" +echo "HASH: `$GHDL version hash`" gend gstart "GHDL help" $GHDL help gend + +for t in $tests; do do_test $t; done + +printf "${ANSI_GREEN}[GHDL - test] SUCCESSFUL${ANSI_NOCOLOR}\n" +touch test_ok |