Skip to content

Commit 588ca83

Browse files
committed
Merge branch 'simver'
2 parents d714855 + a0ae00b commit 588ca83

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/simulator/simulator.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,15 @@
2727
#include <sd.h>
2828
#include <stdio.h>
2929
#include <unistd.h>
30+
#include <version.h>
3031

3132
#include <getopt.h>
3233
#include <netdb.h>
3334
#include <netinet/in.h>
3435
#include <sys/socket.h>
3536

37+
static const char* _simulator_version = "1.0.0";
38+
3639
#define BUFFER_SIZE 1024
3740

3841
int data_len;
@@ -69,14 +72,21 @@ int main(int argc, char* argv[])
6972
// Default port number
7073
int portno = 15423;
7174

72-
struct option long_options[] = {{"port", required_argument, 0, 'p'}, {0, 0, 0, 0}};
75+
struct option long_options[] = {
76+
{"port", required_argument, 0, 'p'}, {"version", no_argument, 0, 'v'}, {0, 0, 0, 0}};
7377

7478
int opt;
7579
while ((opt = getopt_long(argc, argv, "", long_options, NULL)) != -1) {
7680
switch (opt) {
7781
case 'p':
7882
portno = atoi(optarg);
7983
break;
84+
case 'v':
85+
printf(
86+
"bitbox02-multi-%s-simulator-%s-linux-amd64\n",
87+
DIGITAL_BITBOX_VERSION_SHORT,
88+
_simulator_version);
89+
return 0;
8090
default:
8191
fprintf(stderr, "Usage: %s --port <port number>\n", argv[0]);
8292
return 1;

0 commit comments

Comments
 (0)