1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-29 21:55:25 +03:00

udevadm: add --version --help options to man page, hide them as commands

This commit is contained in:
Kay Sievers 2008-09-07 14:48:33 +02:00
parent f640b32fdd
commit e5931bb7d8
4 changed files with 34 additions and 22 deletions

View File

@ -107,7 +107,7 @@
<varlistentry>
<term><option>--debug</option></term>
<listitem>
<para>Print debug output to stderr.</para>
<para>Print debug messages to stderr.</para>
</listitem>
</varlistentry>
<varlistentry>

View 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();

View File

@ -24,7 +24,13 @@
<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>
@ -41,12 +47,6 @@
<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>
@ -56,6 +56,26 @@
</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
@ -351,14 +371,6 @@
</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>

View 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>