summaryrefslogtreecommitdiffstats
path: root/sys-utils/ldattach.c
diff options
context:
space:
mode:
authorSami Kerola2011-11-01 21:17:58 +0100
committerSami Kerola2011-11-02 18:41:57 +0100
commita8023b9aec6f03d3e9ddab22ef814a6a657cd201 (patch)
treeb776e417f9669d3501cb0f670141213d1e474f25 /sys-utils/ldattach.c
parentldattach: fix coding style (diff)
downloadkernel-qcow2-util-linux-a8023b9aec6f03d3e9ddab22ef814a6a657cd201.tar.gz
kernel-qcow2-util-linux-a8023b9aec6f03d3e9ddab22ef814a6a657cd201.tar.xz
kernel-qcow2-util-linux-a8023b9aec6f03d3e9ddab22ef814a6a657cd201.zip
ldattach: align with howto-usage-function.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/ldattach.c')
-rw-r--r--sys-utils/ldattach.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/sys-utils/ldattach.c b/sys-utils/ldattach.c
index 27e9196c2..b032a3850 100644
--- a/sys-utils/ldattach.c
+++ b/sys-utils/ldattach.c
@@ -70,10 +70,10 @@ static const struct ld_table ld_discs[] = {
{ "SYNC_PPP", N_SYNC_PPP },
{ "SYNCPPP", N_SYNC_PPP },
{ "HCI", N_HCI },
- { "GIGASET_M101", N_GIGASET_M101 },
- { "GIGASET", N_GIGASET_M101 },
- { "M101", N_GIGASET_M101 },
{ "PPS", N_PPS },
+ { "M101", N_GIGASET_M101 },
+ { "GIGASET", N_GIGASET_M101 },
+ { "GIGASET_M101", N_GIGASET_M101 },
{ NULL, 0 }
};
@@ -115,7 +115,7 @@ static void print_table(FILE * out, const struct ld_table *tab)
for (t = tab, i = 1; t && t->name; t++, i++) {
fprintf(out, " %-10s", t->name);
- if (!(i % 3))
+ if (!(i % 6))
fputc('\n', out);
}
}
@@ -147,17 +147,30 @@ static void __attribute__ ((__noreturn__)) usage(int exitcode)
{
FILE *out = exitcode == EXIT_SUCCESS ? stdout : stderr;
- fputs(_("\nUsage:\n"), out);
- fprintf(out,
- _(" %s [ -dhV78neo12 ] [ -s <speed> ] [ -i [-]<iflag> ] <ldisc> <device>\n"),
- progname);
-
+ fputs(USAGE_HEADER, out);
+ fprintf(out, _(" %s [options] <ldisc> <device>\n"), program_invocation_short_name);
+ fputs(USAGE_OPTIONS, out);
+
+ fputs(_(" -d, --debug print verbose messages to stderr\n"), out);
+ fputs(_(" -s, --speed <value> set serial line speed\n"), out);
+ fputs(_(" -7, --sevenbits set character size to 7 bits\n"), out);
+ fputs(_(" -8, --eightbits set character size to 8 bits\n"), out);
+ fputs(_(" -n, --noparity set parity to none\n"), out);
+ fputs(_(" -e, --evenparity set parity to even\n"), out);
+ fputs(_(" -o, --oddparity set parity to odd\n"), out);
+ fputs(_(" -1, --onestopbit set stop bits to one\n"), out);
+ fputs(_(" -2, --twostopbits set stop bits to two\n"), out);
+ fputs(_(" -i, --iflag [-]<iflag> set input mode flag\n"), out);
+
+ fputs(USAGE_SEPARATOR, out);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION, out);
fputs(_("\nKnown <ldisc> names:\n"), out);
print_table(out, ld_discs);
-
fputs(_("\nKnown <iflag> names:\n"), out);
print_table(out, ld_iflags);
fputc('\n', out);
+ fprintf(out, USAGE_MAN_TAIL("ldattach(8)"));
exit(exitcode);
}
@@ -250,8 +263,8 @@ int main(int argc, char **argv)
parse_iflag(optarg, &set_iflag, &clr_iflag);
break;
case 'V':
- printf(_("ldattach from %s\n"), PACKAGE_STRING);
- break;
+ printf(UTIL_LINUX_VERSION);
+ return EXIT_SUCCESS;
case 'h':
usage(EXIT_SUCCESS);
default: