From: Cassie Jones Date: Sun, 5 Jan 2020 08:19:02 +0000 (-0500) Subject: Add --version and -version as aliases for -V X-Git-Tag: working-ls180~852^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b76b02358439cd04ed5cad5cb889e8b43c801ac1;p=yosys.git 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 --- 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) {