File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 31
31
} \
32
32
}
33
33
34
+ void print_version () {
35
+ fprintf (stdout, " WARDuino WebAssembly Runtime - " PROJECT_VERSION " \n " );
36
+ }
37
+
34
38
void print_help () {
35
- fprintf (stdout, " WARDuino WebAssembly Runtime - " PROJECT_VERSION " \n\n " );
39
+ print_version ();
40
+ fprintf (stdout, " \n " );
36
41
fprintf (stdout, " Usage:\n " );
37
42
fprintf (stdout, " wdcli <file> [options]\n " );
38
43
fprintf (stdout, " Options:\n " );
@@ -62,6 +67,7 @@ void print_help() {
62
67
" --mode The mode to run in: interpreter, proxy "
63
68
" (default: interpreter)\n " );
64
69
fprintf (stdout, " --invoke Invoke a function from the module\n " );
70
+ fprintf (stdout, " --version Get version information\n " );
65
71
}
66
72
67
73
Module *load (WARDuino wac, const char *file_name, Options opt) {
@@ -284,7 +290,10 @@ int main(int argc, const char *argv[]) {
284
290
}
285
291
286
292
ARGV_SHIFT ();
287
- if (!strcmp (" --help" , arg)) {
293
+ if (!strcmp (" --version" , arg)) {
294
+ print_version ();
295
+ return 0 ;
296
+ } else if (!strcmp (" --help" , arg)) {
288
297
print_help ();
289
298
return 0 ;
290
299
} else if (!strcmp (" --loop" , arg)) {
You can’t perform that action at this time.
0 commit comments