1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-07 00:17:47 +00:00

ls: fix --color behaviour

This commit is contained in:
Terts Diepraam 2021-03-14 21:30:21 +01:00
parent 0717a5f301
commit 5d7a851471

View file

@ -56,7 +56,7 @@ lazy_static! {
let codes = LS_COLORS.split(':'); let codes = LS_COLORS.split(':');
let mut map = HashMap::new(); let mut map = HashMap::new();
for c in codes { for c in codes {
let p: Vec<_> = c.splitn(1, '=').collect(); let p: Vec<_> = c.splitn(2, '=').collect();
if p.len() == 2 { if p.len() == 2 {
map.insert(p[0], p[1]); map.insert(p[0], p[1]);
} }
@ -337,9 +337,9 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
Arg::with_name(options::COLOR) Arg::with_name(options::COLOR)
.long(options::COLOR) .long(options::COLOR)
.help("Color output based on file type.") .help("Color output based on file type.")
.possible_values(&["always", "yes", "force", "tty", "if-tty", "auto", "never", "no", "none"]) .takes_value(true)
.require_equals(true) .require_equals(true)
.empty_values(true), .min_values(0),
) )
.arg(Arg::with_name(options::PATHS).multiple(true).takes_value(true)) .arg(Arg::with_name(options::PATHS).multiple(true).takes_value(true))
.get_matches_from(args); .get_matches_from(args);