aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCassie Jones <code@witchoflight.com>2020-01-05 03:19:02 -0500
committerCassie Jones <code@witchoflight.com>2020-01-05 03:19:02 -0500
commitb76b02358439cd04ed5cad5cb889e8b43c801ac1 (patch)
tree36d3ce10922d2477c7bc3c210408939d2d3e4b6e
parentf8d5920a7e61f78873b7bf49dd7e8f3a83f7adf3 (diff)
downloadyosys-b76b02358439cd04ed5cad5cb889e8b43c801ac1.tar.gz
yosys-b76b02358439cd04ed5cad5cb889e8b43c801ac1.tar.bz2
yosys-b76b02358439cd04ed5cad5cb889e8b43c801ac1.zip
Add --version and -version as aliases for -V
The flag --version is commonly accepted by command line tools. The code for the version flags added here matches the pattern used for the help flag aliases, for consistency. Fixes #1612
-rw-r--r--kernel/driver.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index 70a97c4b9..56899dcc4 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -317,6 +317,12 @@ int main(int argc, char **argv)
exit(0);
}
+ if (argc == 2 && (!strcmp(argv[1], "-V") || !strcmp(argv[1], "-version") || !strcmp(argv[1], "--version")))
+ {
+ printf("%s\n", yosys_version_str);
+ exit(0);
+ }
+
int opt;
while ((opt = getopt(argc, argv, "MXAQTVSgm:f:Hh:b:o:p:l:L:qv:tds:c:W:w:e:D:P:E:")) != -1)
{