This repository has been archived on 2024-09-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
rust-script-tool/crs_template.txt

25 lines
1.1 KiB
Plaintext

#!/usr/bin/env run-cargo-script
// cargo-deps: regex="1.3.9"
fn main() {
unimplemented!("Script is NOT implemented!");
}
// ------------------------------------------------------------------------------------ //
const RED: &str = "\x1B[91m";
const GREEN: &str = "\x1B[92m";
const YELLOW: &str = "\x1B[93m";
const BOLD: &str = "\x1B[1m";
const UNDER: &str = "\x1B[4m";
const END: &str = "\x1B[0m";
fn is_verbose() -> bool { if let Ok(v) = std::env::var("VERBOSE") { v == "1" } else { false } }
fn exit_with_error() -> ! { std::process::exit(1) }
fn exit_with_error_message(msg: &str) -> ! { print_error(msg); exit_with_error() }
fn print_info (msg: &str) { println!("{b}[INFO ]{e} {m}", b = BOLD, e = END, m = msg); }
fn print_ok (msg: &str) { println!("{g}{b}[OK ]{e} {g}{m}{e}", g = GREEN, b = BOLD, e = END, m = msg); }
fn print_warn (msg: &str) { println!("{y}{b}[WARN ]{e} {y}{m}{e}", y = YELLOW, b = BOLD, e = END, m = msg); }
fn print_error(msg: &str) { println!("{r}{b}[ERROR]{e} {r}{m}{e}", r = RED, b = BOLD, e = END, m = msg); }