diff options
Diffstat (limited to 'src/hooks/sed')
| -rw-r--r-- | src/hooks/sed/mod.rs | 19 | ||||
| -rw-r--r-- | src/hooks/sed/parser.rs | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/hooks/sed/mod.rs b/src/hooks/sed/mod.rs index 3128372..7b7906c 100644 --- a/src/hooks/sed/mod.rs +++ b/src/hooks/sed/mod.rs @@ -1,3 +1,22 @@ +//! sed for irc. replace text in past messages +//! +//! Perform sed replaces on single messages in the buffers history, up to 10k messages old. +//! +//! ```text +//! <+basso> crystalmett: welcome back +//! <%audron> s/wel/whale/ +//! <\__{^-_-^}> <basso> crystalmett: whalecome back +//! ``` +//! +//! # Supported flags +//! ```text +//! g global: match every occurrence of the regex in a line +//! i case-insensitive: letters match both upper and lower case +//! s allow . to match \n +//! U swap the meaning of x* and x*? +//! x ignore whitespace and allow line comments (starting with `#`) +//! ``` + use anyhow::{anyhow, bail, Context, Result}; use irc::client::prelude::*; diff --git a/src/hooks/sed/parser.rs b/src/hooks/sed/parser.rs index eb7ef3e..815803c 100644 --- a/src/hooks/sed/parser.rs +++ b/src/hooks/sed/parser.rs @@ -3,7 +3,7 @@ use std::{borrow::Cow, str::Chars}; use bitflags::bitflags; use regex::Regex; -use crate::util::formatting::Formatting; +use crate::util::Formatting; type Commands = Vec<Command>; |
