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
This commit is contained in:
Cassie Jones 2020-01-05 03:19:02 -05:00
parent f8d5920a7e
commit b76b023584
1 changed files with 6 additions and 0 deletions

View File

@ -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)
{