mime: refactor mime detection to separate module; streamline

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I489054d2537a4c0de32d79f793478c206a6a6964
This commit is contained in:
raf 2026-01-23 22:38:21 +03:00
commit ff2f272055
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
5 changed files with 189 additions and 74 deletions

View file

@ -11,6 +11,7 @@ use inquire::Confirm;
mod commands;
pub(crate) mod db;
pub(crate) mod mime;
mod multicall;
#[cfg(feature = "use-toplevel")] mod wayland;
@ -130,6 +131,10 @@ enum Command {
/// Expire new entries after duration (e.g., "3s", "500ms", "1h30m").
#[arg(long, value_parser = parse_duration)]
expire_after: Option<Duration>,
/// MIME type preference for clipboard reading.
#[arg(short = 't', long, default_value = "any")]
mime_type: String,
},
}
@ -433,7 +438,10 @@ fn main() -> color_eyre::eyre::Result<()> {
}
}
},
Some(Command::Watch { expire_after }) => {
Some(Command::Watch {
expire_after,
mime_type,
}) => {
db.watch(
cli.max_dedupe_search,
cli.max_items,
@ -442,6 +450,7 @@ fn main() -> color_eyre::eyre::Result<()> {
#[cfg(not(feature = "use-toplevel"))]
&[],
expire_after,
&mime_type,
);
},