From 47b91b8948d809260adde7c661116540ead3cacf Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 4 Oct 1995 21:19:28 +0000 Subject: (usage): Move to precede all other functions. --- src/join.c | 84 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'src/join.c') diff --git a/src/join.c b/src/join.c index f54d3e58b..2e14ff6e8 100644 --- a/src/join.c +++ b/src/join.c @@ -116,6 +116,48 @@ static struct option const longopts[] = /* Used to print non-joining lines */ static struct line uni_blank; +static void +usage (status) + int status; +{ + if (status != 0) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + { + printf (_("\ +Usage: %s [OPTION]... FILE1 FILE2\n\ +"), + program_name); + printf (_("\ +For each pair of input lines with identical join fields, write a line to\n\ +standard output. The default join field is the first, delimited\n\ +by whitespace. When FILE1 or FILE2 (not both) is -, read standard input.\n\ +\n\ + -a SIDE print unpairable lines coming from file SIDE\n\ + -e EMPTY replace missing input fields with EMPTY\n\ + -j FIELD (Obsolescent) equivalent to `-1 FIELD -2 FIELD'\n\ + -j1 FIELD (Obsolescent) equivalent to `-1 FIELD'\n\ + -j2 FIELD (Obsolescent) equivalent to `-2 FIELD'\n\ + -1 FIELD join on this FIELD of file 1\n\ + -2 FIELD join on this FIELD of file 2\n\ + -o FORMAT obey FORMAT while constructing output line\n\ + -t CHAR use CHAR as input and output field separator\n\ + -v SIDE like -a SIDE, but suppress joined output lines\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ +\n\ +Unless -t CHAR is given, leading blanks separate fields and are ignored,\n\ +else fields are separated by CHAR. Any FIELD is a field number counted\n\ +from 1. FORMAT is one or more comma or blank separated specifications,\n\ +each being `SIDE.FIELD' or `0'. Default FORMAT outputs the join field,\n\ +the remaining fields from FILE1, the remaining fields from FILE2, all\n\ +separated by CHAR.\n\ +")); + } + exit (status); +} + static void ADD_FIELD (line, field, len) struct line *line; @@ -738,45 +780,3 @@ main (argc, argv) exit (0); } - -static void -usage (status) - int status; -{ - if (status != 0) - fprintf (stderr, _("Try `%s --help' for more information.\n"), - program_name); - else - { - printf (_("\ -Usage: %s [OPTION]... FILE1 FILE2\n\ -"), - program_name); - printf (_("\ -For each pair of input lines with identical join fields, write a line to\n\ -standard output. The default join field is the first, delimited\n\ -by whitespace. When FILE1 or FILE2 (not both) is -, read standard input.\n\ -\n\ - -a SIDE print unpairable lines coming from file SIDE\n\ - -e EMPTY replace missing input fields with EMPTY\n\ - -j FIELD (Obsolescent) equivalent to `-1 FIELD -2 FIELD'\n\ - -j1 FIELD (Obsolescent) equivalent to `-1 FIELD'\n\ - -j2 FIELD (Obsolescent) equivalent to `-2 FIELD'\n\ - -1 FIELD join on this FIELD of file 1\n\ - -2 FIELD join on this FIELD of file 2\n\ - -o FORMAT obey FORMAT while constructing output line\n\ - -t CHAR use CHAR as input and output field separator\n\ - -v SIDE like -a SIDE, but suppress joined output lines\n\ - --help display this help and exit\n\ - --version output version information and exit\n\ -\n\ -Unless -t CHAR is given, leading blanks separate fields and are ignored,\n\ -else fields are separated by CHAR. Any FIELD is a field number counted\n\ -from 1. FORMAT is one or more comma or blank separated specifications,\n\ -each being `SIDE.FIELD' or `0'. Default FORMAT outputs the join field,\n\ -the remaining fields from FILE1, the remaining fields from FILE2, all\n\ -separated by CHAR.\n\ -")); - } - exit (status); -} -- cgit v1.2.3-70-g09d2