[CRIU] [PATCH 14/22] compel: cli -- Show own version with option

Cyrill Gorcunov gorcunov at openvz.org
Wed Oct 19 12:21:29 PDT 2016


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 compel/src/main.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/compel/src/main.c b/compel/src/main.c
index f2d09b06432e..ec53cc682e7a 100644
--- a/compel/src/main.c
+++ b/compel/src/main.c
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
 		},
 	};
 
-	static const char short_opts[] = "a:f:o:s:p:v:r:u:hl:L:";
+	static const char short_opts[] = "a:f:o:s:p:v:r:u:hl:L:V";
 	static struct option long_opts[] = {
 		{ "arch",	required_argument,	0, 'a' },
 		{ "file",	required_argument,	0, 'f' },
@@ -133,6 +133,7 @@ int main(int argc, char *argv[])
 		{ "help",	required_argument,	0, 'h' },
 		{ "library",	required_argument,	0, 'l' },
 		{ "library-path",required_argument,	0, 'L' },
+		{ "version",	no_argument,		0, 'V' },
 		{ },
 	};
 
@@ -190,6 +191,13 @@ int main(int argc, char *argv[])
 			}
 			libs[nlibs++] = optarg;
 			break;
+		case 'V':
+			printf("Version: %d.%d.%d\n",
+			       COMPEL_SO_VERSION_MAJOR,
+			       COMPEL_SO_VERSION_MINOR,
+			       COMPEL_SO_VERSION_SUBLEVEL);
+			exit(0);
+			break;
 		default:
 			break;
 		}
-- 
2.7.4



More information about the CRIU mailing list