#![deny(unsafe_code)]
#![deny(
clippy::allow_attributes_without_reason,
clippy::correctness,
unreachable_pub,
)]
#![warn(
clippy::complexity,
clippy::nursery,
clippy::pedantic,
clippy::perf,
clippy::style,
clippy::allow_attributes,
clippy::clone_on_ref_ptr,
clippy::create_dir,
clippy::filetype_is_file,
clippy::format_push_string,
clippy::get_unwrap,
clippy::impl_trait_in_params,
clippy::implicit_clone,
clippy::lossy_float_literal,
clippy::missing_assert_message,
clippy::missing_docs_in_private_items,
clippy::needless_raw_strings,
clippy::panic_in_result_fn,
clippy::pub_without_shorthand,
clippy::rest_pat_in_fully_bound_structs,
clippy::semicolon_inside_block,
clippy::str_to_string,
clippy::todo,
clippy::undocumented_unsafe_blocks,
clippy::unneeded_field_pattern,
clippy::unseparated_literal_suffix,
clippy::unwrap_in_result,
macro_use_extern_crate,
missing_copy_implementations,
missing_docs,
non_ascii_idents,
trivial_casts,
trivial_numeric_casts,
unused_crate_dependencies,
unused_extern_crates,
unused_import_braces,
)]
#![expect(clippy::redundant_pub_crate, reason = "Unresolvable.")]
#![cfg_attr(docsrs, feature(doc_cfg))]
mod ansi;
mod msg;
#[cfg(feature = "fitted")] mod fitted;
#[cfg(feature = "progress")] mod progress;
pub use ansi::AnsiColor;
pub use msg::{
Msg,
kind::MsgKind,
};
#[cfg(feature = "bin_kinds")]
pub use msg::kind::CliCommandArg;
#[cfg(feature = "fitted")]
#[cfg_attr(docsrs, doc(cfg(feature = "fitted")))]
pub use fitted::{
fit_to_width,
length_width,
width,
};
#[cfg(feature = "progress")]
#[cfg_attr(docsrs, doc(cfg(feature = "progress")))]
pub use progress::{
ba::BeforeAfter,
Progless,
error::ProglessError,
guard::ProglessTaskGuard,
};
pub use fyi_ansi;
#[cfg_attr(docsrs, doc(cfg(feature = "signal-hook")))]
#[cfg(feature = "signal-hook")] pub use signal_hook;
#[cfg(test)] use brunch as _;
#[cfg(test)] use rayon as _;
#[macro_use]
mod macros {
#[macro_export(local_inner_macros)]
macro_rules! confirm {
($( @indent $indent:literal )? $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
$( .with_indent($indent) )?
.prompt()
);
($( @indent $indent:literal )? @yes $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
$( .with_indent($indent) )?
.prompt_with_default(true)
);
(@yes $( @indent $indent:literal )? $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
$( .with_indent($indent) )?
.prompt_with_default(true)
);
($( @indent $indent:literal )? @stderr $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
$( .with_indent($indent) )?
.eprompt()
);
(@stderr $( @indent $indent:literal )? $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
$( .with_indent($indent) )?
.eprompt()
);
(@stderr @yes $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
.eprompt_with_default(true)
);
(@yes @stderr $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
.eprompt_with_default(true)
);
(@indent $indent:literal @stderr @yes $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
.with_indent($indent)
.eprompt_with_default(true)
);
(@indent $indent:literal @yes @stderr $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
.with_indent($indent)
.eprompt_with_default(true)
);
(@stderr @indent $indent:literal @yes $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
.with_indent($indent)
.eprompt_with_default(true)
);
(@stderr @yes @indent $indent:literal $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
.with_indent($indent)
.eprompt_with_default(true)
);
(@yes @indent $indent:literal @stderr $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
.with_indent($indent)
.eprompt_with_default(true)
);
(@yes @stderr @indent $indent:literal $text:expr) => (
$crate::Msg::new($crate::MsgKind::Confirm, $text)
.with_indent($indent)
.eprompt_with_default(true)
);
}
}