From b76b02358439cd04ed5cad5cb889e8b43c801ac1 Mon Sep 17 00:00:00 2001 From: Cassie Jones Date: Sun, 5 Jan 2020 03:19:02 -0500 Subject: [PATCH] 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 --- kernel/driver.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- 2.30.2