Merge pull request #1613 from porglezomp-misc/version-flag-alias

Add --version and -version as aliases for -V
This commit is contained in:
Claire Wolf 2020-01-27 12:59:27 +01:00 committed by GitHub
commit de6006fbc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -317,6 +317,12 @@ int main(int argc, char **argv)
exit(0); 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; 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) while ((opt = getopt(argc, argv, "MXAQTVSgm:f:Hh:b:o:p:l:L:qv:tds:c:W:w:e:D:P:E:")) != -1)
{ {