Skip to content

Implement ls -T  #3624

Closed
Closed
@sylvestre

Description

@sylvestre

info ls returns:

    Assume that each tab stop is COLS columns wide. The default is 8. ls uses tabs where possible in the output, for efficiency. If COLS is zero, do not use tabs at all.

    Some terminal emulators might not properly align columns to the right of a TAB following a non-ASCII byte. You can avoid that issue by using the -T0 option or put TABSIZE=0 in your environment, to tell ls to align using spaces, not tabs.

Simple test (uncomment the first line to run GNU's):

export C=./target/debug/coreutils
touch a b
$C ls -w4 -x -T3 a b > out
printf '%s\n' 'a  b' > exp
diff -u exp out

Currently, the option isn't implemented at all
error: Found argument '-T' which wasn't expected, or isn't valid in this context

Maybe a good second bug :)

tested by GNU here:
https://github.com/coreutils/coreutils/blob/master/tests/ls/w-option.sh#L37=
To run it:

bash util/run-gnu-test.sh tests/ls/w-option.sh  

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions