chiark / gitweb /
udevadm: add --version --help options to man page, hide them as commands
authorKay Sievers <kay.sievers@vrfy.org>
Sun, 7 Sep 2008 12:48:33 +0000 (14:48 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Sun, 7 Sep 2008 12:48:33 +0000 (14:48 +0200)
extras/volume_id/vol_id.xml
udev/udevadm.c
udev/udevadm.xml
udev/udevd.xml

index fcf3a31..3ab0b05 100644 (file)
           <varlistentry>
             <term><option>--debug</option></term>
             <listitem>
-              <para>Print debug output to stderr.</para>
+              <para>Print debug messages to stderr.</para>
             </listitem>
           </varlistentry>
           <varlistentry>
index e4f2420..bfa704e 100644 (file)
@@ -63,7 +63,8 @@ static int help(struct udev *udev, int argc, char *argv[])
 
        printf("Usage: udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n");
        for (cmd = cmds; cmd->name != NULL; cmd++)
-               printf("  %-12s %s\n", cmd->name, cmd->help);
+               if (cmd->help != NULL)
+                       printf("  %-12s %s\n", cmd->name, cmd->help);
        printf("\n");
        return 0;
 }
@@ -103,12 +104,10 @@ static const struct command cmds[] = {
        {
                .name = "version",
                .cmd = version,
-               .help = "print the version number",
        },
        {
                .name = "help",
                .cmd = help,
-               .help = "print this help text",
        },
        {}
 };
@@ -210,7 +209,8 @@ int main(int argc, char *argv[])
                        }
                }
 
-       fprintf(stderr, "unknown command, try udevadm help\n\n");
+       fprintf(stderr, "missing or unknown command\n\n");
+       help(udev, argc, argv);
        rc = 2;
 out:
        sysfs_cleanup();
index 2e02c30..0758908 100644 (file)
 
       <refsynopsisdiv>
         <cmdsynopsis>
-          <command>udevadm info <optional>options</optional></command>
+          <command>udevadm</command>
+            <arg><option>--debug</option></arg>
+            <arg><option>--version</option></arg>
+            <arg><option>--help</option></arg>
+        </cmdsynopsis>
+        <cmdsynopsis>
+          <command>udevadm info <replaceable>options</replaceable></command>
         </cmdsynopsis>
         <cmdsynopsis>
           <command>udevadm trigger <optional>options</optional></command>
         <cmdsynopsis>
           <command>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></command>
         </cmdsynopsis>
-        <cmdsynopsis>
-          <command>udevadm version</command>
-        </cmdsynopsis>
-        <cmdsynopsis>
-          <command>udevadm help</command>
-        </cmdsynopsis>
       </refsynopsisdiv>
 
       <refsect1><title>DESCRIPTION</title>
       </refsect1>
 
       <refsect1><title>OPTIONS</title>
+        <variablelist>
+          <varlistentry>
+            <term><option>--debug</option></term>
+            <listitem>
+              <para>Print debug messages to stderr.</para>
+            </listitem>
+          </varlistentry>
+          <varlistentry>
+            <term><option>--version</option></term>
+            <listitem>
+              <para>Print version number.</para>
+            </listitem>
+          </varlistentry>
+          <varlistentry>
+            <term><option>--help</option></term>
+            <listitem>
+              <para>Print help text.</para>
+            </listitem>
+          </varlistentry>
+        </variablelist>
 
         <refsect2><title>udevadm info <replaceable>options</replaceable></title>
           <para>Queries the udev database for device information
             </varlistentry>
           </variablelist>
         </refsect2>
-
-        <refsect2><title>udevadm version</title>
-          <para>Print version number.</para>
-        </refsect2>
-
-        <refsect2><title>udevadm help</title>
-          <para>Print help text.</para>
-        </refsect2>
       </refsect1>
 
       <refsect1><title>AUTHOR</title>
index 8d22a0c..b5726b8 100644 (file)
@@ -61,7 +61,7 @@
           <varlistentry>
             <term><option>--debug</option></term>
             <listitem>
-              <para>Print log messages to stdout.</para>
+              <para>Print debug messages to stderr.</para>
             </listitem>
           </varlistentry>
           <varlistentry>
@@ -71,7 +71,7 @@
             </listitem>
           </varlistentry>
           <varlistentry>
-            <term><option>help</option></term>
+            <term><option>--help</option></term>
             <listitem>
               <para>Print help text.</para>
             </listitem>