join: add -o 'auto' to output a constant number of fields per line
authorPádraig Brady <P@draigBrady.com>
Wed, 5 Jan 2011 11:52:54 +0000 (11:52 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 29 Jan 2011 23:08:31 +0000 (23:08 +0000)
commitd4db0cb1827730ed5536c12c0ebd024283b3a4db
tree091f857d1f547e9468501d14fc58291d2092b27e
parent68a734d66bbe72d5d4133c386fa77069dd77fb8c
join: add -o 'auto' to output a constant number of fields per line

Lines with a different number of fields than the first line,
will be truncated or padded.

* src/join.c (prfields): A new function refactored from prjoin(),
to output all but the join field.
(prjoin): Don't swap line1 and line2 when line1 is blank
so that the padding is applied to the right place.
(main): Handle the -o 'auto' option.
* tests/misc/join: Add 6 new cases to test the auto format.
* NEWS: Mention the change in behavior.
Suggestion from Assaf Gordon
NEWS
doc/coreutils.texi
src/join.c
tests/misc/join