Skip to content

Commit

Permalink
[c] --version
Browse files Browse the repository at this point in the history
```
$ ./rosettaboy-release --version
Apple LLVM 15.0.0 (clang-1500.0.40.1)
```
  • Loading branch information
shish committed Sep 30, 2023
1 parent 4448075 commit 49c0a74
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion c/src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static void print_usage(void) {
" -f, --frames=FRAMES Exit after N frames\n"
" -p, --profile=PROFILE Exit after N seconds\n"
" -t, --turbo No sleep between frames\n"
" -v, --version Print build information\n"
);
exit(0);
}
Expand All @@ -38,6 +39,7 @@ static struct option long_options[] = {
{"frames", required_argument, 0, 'f'},
{"profile", required_argument, 0, 'p'},
{"turbo", no_argument, 0, 't'},
{"version", no_argument, 0, 'v'},
{0, 0, 0, 0 }
};

Expand All @@ -46,7 +48,7 @@ void parse_args(struct Args *args, int argc, char *argv[]) {

while (1) {
int option_index = 0;
int c = getopt_long(argc, argv, "hHScgarf:p:t", long_options, &option_index);
int c = getopt_long(argc, argv, "hHScgarf:p:tv", long_options, &option_index);
if (c == -1) {
break;
}
Expand Down Expand Up @@ -89,6 +91,11 @@ void parse_args(struct Args *args, int argc, char *argv[]) {
case 't':
args->turbo = true;
break;

case 'v':
printf("%s\n", __VERSION__);
exit(0);
break;
}
}

Expand Down

0 comments on commit 49c0a74

Please sign in to comment.