@@ -661,6 +661,7 @@ static void print_usage() {
661661
662662 puts (" -h, --help show this help" );
663663 puts (" --help-config show help on configuration" );
664+ puts (" -v, --version show version" );
664665 puts (" -c, --config=FILE use given configuration file" );
665666 puts (" -r, --restrict=AREA restrict to given area (wxh+x+y)" );
666667 puts (" -o, --option set configuration option" );
@@ -670,6 +671,14 @@ static void print_usage() {
670671 );
671672}
672673
674+ static void print_version () {
675+ printf ("wl-kbptr %s" , VERSION );
676+ #if OPENCV_ENABLED
677+ printf (" (opencv)" );
678+ #endif
679+ puts ("" );
680+ }
681+
673682int main (int argc , char * * argv ) {
674683 struct state state = {
675684 .wl_display = NULL ,
@@ -701,6 +710,7 @@ int main(int argc, char **argv) {
701710 static struct option long_options [] = {
702711 {"help" , no_argument , 0 , 'h' },
703712 {"help-config" , no_argument , 0 , 'H' },
713+ {"version" , no_argument , 0 , 'v' },
704714 {"restrict" , required_argument , 0 , 'r' },
705715 {"config" , required_argument , 0 , 'c' },
706716 {"output" , required_argument , 0 , 'O' },
@@ -720,6 +730,10 @@ int main(int argc, char **argv) {
720730 print_usage ();
721731 return 0 ;
722732
733+ case 'v' :
734+ print_version ();
735+ return 0 ;
736+
723737 case 'r' :
724738 if (sscanf (
725739 optarg , "%dx%d+%d+%d" , & state .initial_area .w ,
0 commit comments