Subject: coreutils: stty: * (non-POSIX) markings in manual wrong

From: наб <[email-masked]>
Date: Wed, 7 Sep 2022 17:51:11 +0200

Package: coreutils
Version: 8.32-4+b1
Severity: normal

Dear Maintainer,

With some text processing of the Issue 8 Draft 2.1 and stty --help,
I produced this listing of correct markings for coreutils:
-- >8 --
$ sed -e 's/^/ /' -e 's/^ -/-/' gnu-minus-posix | tr '-' '\t' | LC_ALL=C sort -b  | tr '\t' - | LC_ALL=C uniq -cs1 | sed -e 's/1  /1 /' -e  's/2 -/1 [-]/' | tr '1' \* | tr -s ' ' | LC_ALL=C sort | tee markings.s
 * -cooked
 * -xcase
 * [-]cbreak
 * [-]cmspar
 * [-]crterase
 * [-]crtkill
 * [-]crtscts
 * [-]ctlecho
 * [-]decctlq
 * [-]drain
 * [-]echoctl
 * [-]echoke
 * [-]echoprt
 * [-]extproc
 * [-]flusho
 * [-]imaxbel
 * [-]iutf8
 * [-]litout
 * [-]pass8
 * [-]prterase
 * [-]tandem
 * columns
 * crt
 * dec
 * discard
 * eol2
 * line
 * lnext
 * rprnt
 * speed
 * swtch
 * werase
-- >8 --

Of note:
  * [-]iuclc xcase [-]olcuc [-]lcase [-]LCASE
    are removed in Issue 5 (but still mentioned in the CHANGE HISTORY)
  * this means that -xcase isn't. but there also isn't a -xcase
    (the functionality was removed, so I assume this is either an error
     in the log, or it was never there, cba to check rn)
  * size rows cols
    are new in Issue 8
  * this is strictly denominational w.r.t. aliases,
    which is the only correct approach,
    but the current usage string isn't
  * [-]onlcr [-]ocrnl [-]onocr [-]onlret [-]ofill [-]ofdel cr[0123]
    nl[01] tab[0123] [-]tabs bs[01] ff[01] vt[01] [-]raw cooked
    are all shaded XSI
  * raw equivalent is to the prescribed one
    (but the prescribed one is odd, so)

Which yields this table:
-- >8 --
# Missing markings        Extraneous markings      Correct markings
$ LC_ALL=C comm markings.s gnu-markings.s | expand -t 25
 * -cooked
                          * -crtkill
                          * -tabs
 * -xcase
                          * [-]LCASE
 * [-]cbreak
                                                   * [-]cmspar
 * [-]crterase
 * [-]crtkill
                                                   * [-]crtscts
                                                   * [-]ctlecho
                                                   * [-]decctlq
                                                   * [-]drain
                                                   * [-]echoctl
                                                   * [-]echoke
                                                   * [-]echoprt
                                                   * [-]extproc
                                                   * [-]flusho
                                                   * [-]imaxbel
                          * [-]iuclc
                                                   * [-]iutf8
                          * [-]ixany
                          * [-]lcase
 * [-]litout
                          * [-]ocrnl
                          * [-]ofdel
                          * [-]ofill
                          * [-]olcuc
                          * [-]onlcr
                          * [-]onlret
                          * [-]onocr
 * [-]pass8
                                                   * [-]prterase
 * [-]tandem
                          * [-]tostop
                          * [-]xcase
                          * bsN
                          * cols
                                                   * columns
                          * crN
 * crt
                          * crtkill
 * dec
                                                   * discard
                                                   * eol2
                          * ffN
                                                   * line
                                                   * lnext
                          * nlN
                          * rows
                                                   * rprnt
                          * size
 * speed
                                                   * swtch
                          * tabN
                          * tabs
                          * vtN
                                                   * werase
-- >8 --

Best,
наб

-- System Information:
Debian Release: 11.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-17-amd64 (SMP w/24 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages coreutils depends on:
ii  libacl1      2.2.53-10
ii  libattr1     1:2.4.48-6
ii  libc6        2.31-13+deb11u3
ii  libgmp10     2:6.2.1+dfsg-1+deb11u1
ii  libselinux1  3.1-3

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information

---

From: наб <[email-masked]>
Date: Sat, 10 Sep 2022 01:03:32 +0200

Hi!

>      in the log, or it was never there, cba to check rn)

I have since validated this, reported it upstream, and this was an
error, supposed to read xcase(-xcase), and will be fixed in Draft 3:
  https://www.mail-archive.com/[email-masked]/msg10129.html

The updated listing of correct markings is:
-- >8 --
 * -cooked
 * [-]cbreak
 * [-]cmspar
 * [-]crterase
 * [-]crtkill
 * [-]crtscts
 * [-]ctlecho
 * [-]decctlq
 * [-]drain
 * [-]echoctl
 * [-]echoke
 * [-]echoprt
 * [-]extproc
 * [-]flusho
 * [-]imaxbel
 * [-]iutf8
 * [-]litout
 * [-]pass8
 * [-]prterase
 * [-]tandem
 * columns
 * crt
 * dec
 * discard
 * eol2
 * line
 * lnext
 * rprnt
 * speed
 * swtch
 * werase
-- >8 --

And diff against these is:
-- >8 --
 # Missing markings        Extraneous markings      Correct markings
 * -cooked
                          * -crtkill
                          * -tabs
                          * [-]LCASE
 * [-]cbreak
                                                   * [-]cmspar
 * [-]crterase
 * [-]crtkill
                                                   * [-]crtscts
                                                   * [-]ctlecho
                                                   * [-]decctlq
                                                   * [-]drain
                                                   * [-]echoctl
                                                   * [-]echoke
                                                   * [-]echoprt
                                                   * [-]extproc
                                                   * [-]flusho
                                                   * [-]imaxbel
                          * [-]iuclc
                                                   * [-]iutf8
                          * [-]ixany
                          * [-]lcase
 * [-]litout
                          * [-]ocrnl
                          * [-]ofdel
                          * [-]ofill
                          * [-]olcuc
                          * [-]onlcr
                          * [-]onlret
                          * [-]onocr
 * [-]pass8
                                                   * [-]prterase
 * [-]tandem
                          * [-]tostop
                          * [-]xcase
                          * bsN
                          * cols
                                                   * columns
                          * crN
 * crt
                          * crtkill
 * dec
                                                   * discard
                                                   * eol2
                          * ffN
                                                   * line
                                                   * lnext
                          * nlN
                          * rows
                                                   * rprnt
                          * size
 * speed
                                                   * swtch
                          * tabN
                          * tabs
                          * vtN
                                                   * werase
-- >8 --

Best,
наб