Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/onefetch/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,20 @@ impl Cli {
.possible_values(color_values)
.help("Colors (X X X...) to print the ascii art."),
)
.arg(
Arg::with_name("true-color")
.long("true-color")
.value_name("WHEN")
.takes_value(true)
.possible_values(&["auto", "never", "always"])
.default_value("auto")
.hide_default_value(true)
.help("Specify when to use true color (*auto*, never, always).")
.long_help(
"Specify when to use true color (*auto*, never, always). \n\
If set to auto: true color will be enabled if supported by the terminal."
)
)
.arg(
Arg::with_name("text-colors")
.short("t")
Expand Down Expand Up @@ -249,7 +263,12 @@ impl Cli {
)
.get_matches();

let true_color = cli_utils::is_truecolor_terminal();
let true_color = match matches.value_of("true-color") {
Some("always") => true,
Some("never") => false,
Some("auto") => cli_utils::is_truecolor_terminal(),
_ => unreachable!(),
};
let no_bold = matches.is_present("no-bold");
let no_merges = matches.is_present("no-merge-commits");
let no_color_palette = matches.is_present("no-color-palette");
Expand Down