Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use owo-colors instead of anstyle #183

Merged
merged 8 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
58 changes: 47 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ version = "0.11.0"
edition = "2021"

[dependencies]
anstyle = "0.2"
anyhow = "1.0"
const_format = "0.2"
is-terminal = "0.4"
libc = "0.2"
owo-colors = "3"
supports-color = "1"
thiserror = "1.0"
terminal_size = "0.2"

Expand Down
10 changes: 5 additions & 5 deletions src/bin/hexyl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ use std::num::{NonZeroI64, NonZeroU64, NonZeroU8};
use clap::builder::ArgPredicate;
use clap::{crate_name, crate_version, Arg, ArgAction, ColorChoice, Command};

use is_terminal::IsTerminal;

use anyhow::{anyhow, Context, Result};

use const_format::formatcp;
Expand Down Expand Up @@ -296,8 +294,10 @@ fn run() -> Result<()> {

let show_color = match matches.get_one::<String>("color").map(String::as_ref) {
Some("never") => false,
Some("auto") => std::io::stdout().is_terminal(),
_ => true,
Some("always") => true,
_ => supports_color::on_cached(supports_color::Stream::Stdout)
sharifhsn marked this conversation as resolved.
Show resolved Hide resolved
.map(|level| level.has_basic)
.unwrap_or(false),
};

let border_style = match matches.get_one::<String>("border").map(String::as_ref) {
Expand Down Expand Up @@ -453,7 +453,7 @@ fn main() {
std::process::exit(0);
}
}
eprintln!("Error: {:?}", err);
eprintln!("Error: {err:?}");
std::process::exit(1);
}
}
Expand Down
Loading