1+ #include " build-info.h"
2+
13#include < cstdio>
24#include < string>
35#include < vector>
@@ -9,6 +11,7 @@ int llama_cli(int argc, char ** argv);
911int llama_completion (int argc, char ** argv);
1012int llama_bench (int argc, char ** argv);
1113static int help (int argc, char ** argv);
14+ static int version (int argc, char ** argv);
1215
1316struct command {
1417 const char * name;
@@ -23,9 +26,15 @@ static const command cmds[] = {
2326 {" cli" , " Command-line interactive interface" , {" client" }, false , llama_cli },
2427 {" completion" , " Text completion" , {" complete" }, true , llama_completion },
2528 {" bench" , " Benchmarking tool" , {}, true , llama_bench },
29+ {" version" , " Show version" , {}, true , version },
2630 {" help" , " Show available commands" , {}, true , help },
2731};
2832
33+ static int version (int argc, char ** argv) {
34+ printf (" %s\n " , llama_build_info ());
35+ return 0 ;
36+ }
37+
2938static int help (int argc, char ** argv) {
3039 const bool show_all = argc >= 2 && std::string (argv[1 ]) == " all" ;
3140
0 commit comments