]> err.no Git - systemd/commitdiff
add option --version to udevd
authorMatthias Schwarzott <zzam@gentoo.org>
Sat, 24 Feb 2007 22:43:36 +0000 (23:43 +0100)
committerKay Sievers <kay.sievers@suse.de>
Sat, 24 Feb 2007 22:43:36 +0000 (23:43 +0100)
udevd.8
udevd.c
udevd.xml

diff --git a/udevd.8 b/udevd.8
index 858e9aab6b660b0dd2531b61899fd4cddcac4a6e..d21f1d754c0d29f1242e082885273ca97e012ed5 100644 (file)
--- a/udevd.8
+++ b/udevd.8
@@ -14,7 +14,7 @@
 udevd \- event managing daemon
 .SH "SYNOPSIS"
 .HP 6
-\fBudevd\fR [\fB\-\-daemon\fR] [\fB\-\-debug\-trace\fR] [\fB\-\-verbose\fR] [\fB\-\-help\fR]
+\fBudevd\fR [\fB\-\-daemon\fR] [\fB\-\-debug\-trace\fR] [\fB\-\-verbose\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
 .HP 20
 \fBudevcontrol \fR\fB\fIcommand\fR\fR
 .SH "DESCRIPTION"
@@ -37,6 +37,11 @@ Run all events completely serialized. This may be useful if udev triggers action
 Print log messages to stdout.
 .RE
 .PP
+\fB\-\-version\fR
+.RS 4
+Print version number.
+.RE
+.PP
 \fB\-\-help\fR
 .RS 4
 Print usage.
diff --git a/udevd.c b/udevd.c
index 8c550d38aa3b8f2154c2fc0a073ac75811d6476d..23f5fd6980183a2cf56481b3ee903914f6b85512 100644 (file)
--- a/udevd.c
+++ b/udevd.c
@@ -943,6 +943,7 @@ int main(int argc, char *argv[], char *envp[])
                { "debug-trace", 0, NULL, 't' },
                { "verbose", 0, NULL, 'v' },
                { "help", 0, NULL, 'h' },
+               { "version", 0, NULL, 'V' },
                {}
        };
        int rc = 1;
@@ -955,7 +956,7 @@ int main(int argc, char *argv[], char *envp[])
 
        /* parse commandline options */
        while (1) {
-               option = getopt_long(argc, argv, "dtvh", options, NULL);
+               option = getopt_long(argc, argv, "dtvhV", options, NULL);
                if (option == -1)
                        break;
 
@@ -972,7 +973,10 @@ int main(int argc, char *argv[], char *envp[])
                                udev_log_priority = LOG_INFO;
                        break;
                case 'h':
-                       printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--verbose]\n");
+                       printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--verbose] [--version]\n");
+                       goto exit;
+               case 'V':
+                       printf("%s\n", UDEV_VERSION);
                        goto exit;
                default:
                        goto exit;
index fbff8bab9761f4f83b684588adff8a30c29bf7e3..84182884b66a9b23038bf71274753eb6d062804e 100644 (file)
--- a/udevd.xml
+++ b/udevd.xml
@@ -28,6 +28,7 @@
           <arg><option>--daemon</option></arg>
           <arg><option>--debug-trace</option></arg>
           <arg><option>--verbose</option></arg>
+          <arg><option>--version</option></arg>
           <arg><option>--help</option></arg>
         </cmdsynopsis>
         <cmdsynopsis>
               <para>Print log messages to stdout.</para>
             </listitem>
           </varlistentry>
+          <varlistentry>
+            <term><option>--version</option></term>
+            <listitem>
+              <para>Print version number.</para>
+            </listitem>
+          </varlistentry>
           <varlistentry>
             <term><option>--help</option></term>
             <listitem>