summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
author童宗振 <[email protected]>2024-04-12 09:05:44 +0000
committer童宗振 <[email protected]>2024-04-12 09:05:44 +0000
commit21522870f7a4dea01db7a024038e4a8f1f75b9e7 (patch)
treec14cc4a1e0301a0a86b894a2e9adf6eea1cfde41 /src/main.c
parent97284a9b278838a8e84beb54ce18653d3ed42c4d (diff)
Add packet
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 1f318df..60fda1e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -69,7 +69,8 @@ void usage()
"\n"
" -c config file path\n"
" -d dynamic config file path\n"
- " -h\n"
+ " -v show current version\n"
+ " -h \n"
"\n");
exit(0);
}
@@ -81,7 +82,7 @@ int main(int argc, char * argv[])
char config_path[PATH_MAX];
char dy_config_path[PATH_MAX];
int opt = 0;
- while ((opt = getopt(argc, argv, "c:d:h")) != -1)
+ while ((opt = getopt(argc, argv, "c:d:hv")) != -1)
{
char * endptr = NULL;
switch (opt)
@@ -98,6 +99,10 @@ int main(int argc, char * argv[])
snprintf(dy_config_path, sizeof(dy_config_path), "%s", optarg);
break;
}
+ case 'v': {
+ printf("dp_trace_telemetry current version: %s\n", DP_TRACE_VERSION);
+ exit(0);
+ }
default:
usage();
break;