mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
ls: silently ignore -T
option (#3718)
* ls: silently ignore `-T` option
This commit is contained in:
parent
eeb4cdab58
commit
4e72e284b5
2 changed files with 45 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
||||||
// For the full copyright and license information, please view the LICENSE file
|
// For the full copyright and license information, please view the LICENSE file
|
||||||
// that was distributed with this source code.
|
// that was distributed with this source code.
|
||||||
|
|
||||||
// spell-checker:ignore (ToDO) cpio svgz webm somegroup nlink rmvb xspf
|
// spell-checker:ignore (ToDO) cpio svgz webm somegroup nlink rmvb xspf tabsize
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate uucore;
|
extern crate uucore;
|
||||||
|
@ -62,6 +62,7 @@ pub mod options {
|
||||||
pub static LONG: &str = "long";
|
pub static LONG: &str = "long";
|
||||||
pub static COLUMNS: &str = "C";
|
pub static COLUMNS: &str = "C";
|
||||||
pub static ACROSS: &str = "x";
|
pub static ACROSS: &str = "x";
|
||||||
|
pub static TAB_SIZE: &str = "tabsize"; // silently ignored (see #3624)
|
||||||
pub static COMMAS: &str = "m";
|
pub static COMMAS: &str = "m";
|
||||||
pub static LONG_NO_OWNER: &str = "g";
|
pub static LONG_NO_OWNER: &str = "g";
|
||||||
pub static LONG_NO_GROUP: &str = "o";
|
pub static LONG_NO_GROUP: &str = "o";
|
||||||
|
@ -891,6 +892,15 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
options::format::COLUMNS,
|
options::format::COLUMNS,
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
|
.arg( // silently ignored (see #3624)
|
||||||
|
Arg::new(options::format::TAB_SIZE)
|
||||||
|
.short('T')
|
||||||
|
.long(options::format::TAB_SIZE)
|
||||||
|
.env("TABSIZE")
|
||||||
|
.takes_value(true)
|
||||||
|
.value_name("COLS")
|
||||||
|
.help("Assume tab stops at each COLS instead of 8 (unimplemented)")
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::format::COMMAS)
|
Arg::new(options::format::COMMAS)
|
||||||
.short('m')
|
.short('m')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// spell-checker:ignore (words) READMECAREFULLY birthtime doesntexist oneline somebackup lrwx somefile somegroup somehiddenbackup somehiddenfile
|
// spell-checker:ignore (words) READMECAREFULLY birthtime doesntexist oneline somebackup lrwx somefile somegroup somehiddenbackup somehiddenfile tabsize aaaaaaaa bbbb cccc dddddddd ncccc
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
@ -3117,3 +3117,36 @@ fn test_dereference_symlink_file_color() {
|
||||||
.succeeds()
|
.succeeds()
|
||||||
.stdout_is(out_exp);
|
.stdout_is(out_exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_tabsize_option() {
|
||||||
|
let scene = TestScenario::new(util_name!());
|
||||||
|
|
||||||
|
scene.ucmd().args(&["-T", "3"]).succeeds();
|
||||||
|
scene.ucmd().args(&["--tabsize", "0"]).succeeds();
|
||||||
|
scene.ucmd().arg("-T").fails();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[ignore = "issue #3624"]
|
||||||
|
#[test]
|
||||||
|
fn test_tabsize_formatting() {
|
||||||
|
let (at, mut ucmd) = at_and_ucmd!();
|
||||||
|
|
||||||
|
at.touch("aaaaaaaa");
|
||||||
|
at.touch("bbbb");
|
||||||
|
at.touch("cccc");
|
||||||
|
at.touch("dddddddd");
|
||||||
|
|
||||||
|
ucmd.args(&["-T", "4"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_is("aaaaaaaa bbbb\ncccc\t dddddddd");
|
||||||
|
|
||||||
|
ucmd.args(&["-T", "2"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_is("aaaaaaaa bbbb\ncccc\t\t dddddddd");
|
||||||
|
|
||||||
|
// use spaces
|
||||||
|
ucmd.args(&["-T", "0"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_is("aaaaaaaa bbbb\ncccc dddddddd");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue