diff --git a/Cargo.toml b/Cargo.toml index 6a9ed44..4dac13e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,20 +1,33 @@ [package] name = "rematch" -version = "0.1.0" +version = "1.0.0" authors = ["Avril "] -edition = "2018" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [profile.release] opt-level = 3 -lto = "fat" +lto = true codegen-units = 1 panic = "unwind" +strip = true + +[profile.symbols] +inherits = "release" +strip = false [features] -perl = ["pcre"] +default = ["perl"] + +# Enable the use of PCRE (extended matching) instead of Rust regexes. +perl = ["dep:pcre"] + +unstable = ["regex/unstable"] [dependencies] -regex = "1" +clap = { version = "4.5.34", features = ["derive", "env", "string"] } +color-eyre = { version = "0.6.3", default-features = false, features = ["track-caller"] } pcre = { version = "0.2.3", optional = true } +rayon = "1.10.0" +regex = { version = "1.11.1", features = ["use_std"] } diff --git a/src/main.rs b/src/main.rs index ec80323..9c2ace6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,26 @@ -#![allow(dead_code)] mod re; mod text; -fn main() -> Result<(), Box> +use color_eyre::{ + eyre::{ + self, + eyre, + WrapErr as _, + }, + SectionExt as _, Help as _, +}; + +fn initialise() -> eyre::Result<()> +{ + color_eyre::install()?; + Ok(()) +} + +fn main() -> eyre::Result<()> { + initialise().wrap_err("Fatal: Failed to install panic handle")?; + let args: Vec = std::env::args().collect(); if args.len() < 4 {