Skip to content

Commit 76b4628

Browse files
committed
cleanup: use fyi_ansi for formatting
1 parent fa4cfdb commit 76b4628

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ dowser = "0.12.*"
8787
[dependencies]
8888
dactyl = "0.10.*"
8989
dowser = "0.12.*"
90+
fyi_ansi = "2.0.*"
9091
fyi_msg = "2.0.*"
9192
svg = "=0.18.0"
9293
write_atomic = "0.6.*"

src/error.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
# Yesvgmap: Errors
33
*/
44

5+
use fyi_ansi::{
6+
ansi,
7+
csi,
8+
dim,
9+
};
510
use std::{
611
error::Error,
712
fmt,
@@ -24,7 +29,7 @@ const HELP: &str = concat!(r#"
2429
'. /`\ ( '._/
2530
`\ .; | . '.
2631
).' )/| \
27-
` ` | \| | "#, "\x1b[38;5;199mYesvgmap\x1b[0;38;5;69m v", env!("CARGO_PKG_VERSION"), "\x1b[0m", r#"
32+
` ` | \| | "#, csi!(199), "Yesvgmap", ansi!((cornflower_blue) " v", env!("CARGO_PKG_VERSION")), r#"
2833
\ | | SVG sprite generator.
2934
'.| |
3035
\ '\__
@@ -113,7 +118,11 @@ impl fmt::Display for SvgError {
113118
match self {
114119
Self::Duplicate(s) => write!(f, "Normalized name collision: {s}."),
115120
Self::FileName(p) => write!(f, "File name has no ASCII alphanumeric or '-': {p:?}"),
116-
Self::InvalidCli(s) => write!(f, "Invalid/unknown arg: \x1b[2m{s}\x1b[0m"),
121+
Self::InvalidCli(s) => write!(
122+
f,
123+
concat!("Invalid/unknown arg: ", dim!("{}")),
124+
s,
125+
),
117126
Self::Parse(p) => write!(f, "Unable to parse: {p:?}."),
118127
Self::Read(p) => write!(f, "Unreadable: {p:?}."),
119128
Self::Viewbox(p) => write!(f, "Missing viewBox: {p:?}"),

src/img.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
use crate::SvgError;
6+
use fyi_ansi::ansi;
67
use fyi_msg::Msg;
78
use std::{
89
borrow::Cow,
@@ -155,7 +156,7 @@ contexts; the following image{} might need to be refactored:",
155156

156157
warned.sort_unstable();
157158
for w in warned {
158-
eprintln!(" \x1b[1;93m•\x1b[0m {w}");
159+
eprintln!(concat!(ansi!((bold, light_yellow) " •"), " {}"), w);
159160
}
160161
}
161162

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy