[systemd-devel] [PATCH 2/2] keymap: add --version option

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Jul 16 22:31:48 PDT 2012


---
 src/udev/keymap/keymap.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/udev/keymap/keymap.c b/src/udev/keymap/keymap.c
index 051aa42..5cbce86 100644
--- a/src/udev/keymap/keymap.c
+++ b/src/udev/keymap/keymap.c
@@ -362,8 +362,13 @@ static void help(int error)
 
 int main(int argc, char **argv)
 {
+        enum {
+                ARG_VERSION = 0x100,
+        };
+
         static const struct option options[] = {
                 { "help", no_argument, NULL, 'h' },
+                { "version", no_argument, NULL, ARG_VERSION },
                 { "interactive", no_argument, NULL, 'i' },
                 {}
         };
@@ -382,6 +387,10 @@ int main(int argc, char **argv)
                 case 'h':
                         help(0);
 
+                case ARG_VERSION:
+                        puts(PACKAGE_STRING);
+                        exit(0);
+
                 case 'i':
                         opt_interactive = 1;
                         break;
-- 
1.7.11.1.282.g511ba53



More information about the systemd-devel mailing list