#1068876 coreutils: join: -a doesn't exclude -v (ought to per POSIX), confusing behaviour when combined

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
наб
Date:
2024-04-12 17:24:03 UTC
Severity:
normal
#1068876#5
Date:
2024-04-12 17:21:45 UTC
From:
To:
Dear Maintainer,

Given
	$ cat f1
	row1	f1	1
	urow1	f1	2
	$ cat f2
	row1	f2	1
	urow2	f2	2
and join(1)
	-a FILENUM
	       also print unpairable lines from file FILENUM, where FILENUM is 1
	       or 2, corresponding to FILE1 or FILE2
	-v FILENUM
	       like -a FILENUM, but suppress joined output lines
and POSIX.1-202x/D3, XCU, join
	100437	SYNOPSIS
	100438		join [-a file_number|-v file_number] [-e string] [-o list] [-t char]
	100439		[-1 field] [-2 field] file1 file2

	100460	OPTIONS
	100463	−a file_number
	100464		Produce a line for each unpairable line in file file_number, where file_number is 1 or
	100465		2, in addition to the default output. If both −a1 and −a2 are specified, all unpairable
	100466		lines shall be output.
	100482	−v file_number
	100483		Instead of the default output, produce a line only for each unpairable line in
	100484		file_number, where file_number is 1 or 2. If both −v1 and −v2 are specified, all
	100485		unpairable lines shall be output.
we observe:
	$ join         f?
	row1 f1 1 f2 1
	$ join -v1     f?
	urow1 f1 2
	$ join -v1 -a1 f?
	urow1 f1 2
	$ join -v1 -a2 f?
	urow1 f1 2
	urow2 f2 2

This does not conform to POSIX (should be refused);
the manual implies some sort of separate accounting for -a and -v
(and the interaxion is not described at all),
but -v 1 appears to just be -v -a1. Why?

Best,
наб