]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
implement --version
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 7 May 2015 16:25:52 +0000 (11:25 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 7 May 2015 17:25:35 +0000 (12:25 -0500)
Because this is needed for help2man to determine the program name.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lxcfs.c

diff --git a/lxcfs.c b/lxcfs.c
index 2bb0eb47cb0925e83a76ade71f57c346f85302fc..1faee5f31894e678174dc302a663303e8b81fd50 100644 (file)
--- a/lxcfs.c
+++ b/lxcfs.c
@@ -29,6 +29,7 @@
 #include <nih/string.h>
 
 #include "cgmanager.h"
+#include "config.h" // for VERSION
 
 struct lxcfs_state {
        /*
@@ -2588,6 +2589,10 @@ int main(int argc, char *argv[])
        swallow_arg(&argc, argv, "-f");
        swallow_option(&argc, argv, "-o", "allow_other");
 
+       if (argc == 2  && strcmp(argv[1], "--version") == 0) {
+               fprintf(stderr, "%s\n", VERSION);
+               exit(0);
+       }
        if (argc != 2 || is_help(argv[1]))
                usage(argv[0]);