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;
}
{
.name = "version",
.cmd = version,
- .help = "print the version number",
},
{
.name = "help",
.cmd = help,
- .help = "print this help text",
},
{}
};
}
}
- 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();
<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>
<varlistentry>
<term><option>--debug</option></term>
<listitem>
- <para>Print log messages to stdout.</para>
+ <para>Print debug messages to stderr.</para>
</listitem>
</varlistentry>
<varlistentry>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>help</option></term>
+ <term><option>--help</option></term>
<listitem>
<para>Print help text.</para>
</listitem>