mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 17:35:16 +01:00
Fix case of color options to ls
This commit is contained in:
parent
b7f5f4ac7d
commit
066ce41299
2 changed files with 12 additions and 1 deletions
11
src/cli.rs
11
src/cli.rs
|
@ -655,6 +655,17 @@ pub enum ColorWhen {
|
||||||
Never,
|
Never,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ColorWhen {
|
||||||
|
pub fn as_str(&self) -> &'static str {
|
||||||
|
use ColorWhen::*;
|
||||||
|
match *self {
|
||||||
|
Auto => "auto",
|
||||||
|
Always => "always",
|
||||||
|
Never => "never",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// there isn't a derive api for getting grouped values yet,
|
// there isn't a derive api for getting grouped values yet,
|
||||||
// so we have to use hand-rolled parsing for exec and exec-batch
|
// so we have to use hand-rolled parsing for exec and exec-batch
|
||||||
pub struct Exec {
|
pub struct Exec {
|
||||||
|
|
|
@ -293,7 +293,7 @@ fn extract_command(opts: &mut Opts, colored_output: bool) -> Result<Option<Comma
|
||||||
if !opts.list_details {
|
if !opts.list_details {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let color_arg = format!("--color={:?}", opts.color);
|
let color_arg = format!("--color={}", opts.color.as_str());
|
||||||
|
|
||||||
let res = determine_ls_command(&color_arg, colored_output)
|
let res = determine_ls_command(&color_arg, colored_output)
|
||||||
.map(|cmd| CommandSet::new_batch([cmd]).unwrap());
|
.map(|cmd| CommandSet::new_batch([cmd]).unwrap());
|
||||||
|
|
Loading…
Reference in a new issue