You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
amethyst/src/internal/mod.rs

47 lines
1.0 KiB
Rust

mod clean;
pub mod commands;
pub mod error;
pub mod exit_code;
mod initialise;
pub mod rpc;
mod sort;
3 years ago
mod strings;
pub mod structs;
pub use clean::*;
pub use initialise::*;
pub use sort::*;
use std::env;
pub use strings::*;
3 years ago
#[macro_export]
macro_rules! uwu {
($x:expr) => {{
let uwu: String = String::from($x);
3 years ago
let uwu = uwu.replace("l", "w");
let uwu = uwu.replace("L", "W");
let uwu = uwu.replace("r", "w");
let uwu = uwu.replace("R", "W");
let uwu = uwu.replace("na", "nya");
let uwu = uwu.replace("Na", "Nya");
let uwu = uwu.replace("NA", "NYA");
uwu
}};
}
pub fn uwu_enabled() -> bool {
env::var("AME_UWU").unwrap_or_else(|_| "".to_string()) == "true"
}
pub fn uwu_debug_enabled() -> bool {
env::var("AME_UWU_DEBUG").unwrap_or_else(|_| "".to_string()) == "true"
}
/// Checks if we're running in a tty. If we do we can assume that
/// the output can safely be colorized.
pub fn is_tty() -> bool {
(unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0)
}