diff --git a/Cargo.lock b/Cargo.lock index 49d1581..25e1004 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1424,10 +1424,8 @@ dependencies = [ "rustc-hash", "serde", "signal-hook", - "strum", "television-derive", "tempfile", - "thiserror 2.0.12", "tokio", "toml", "tracing", diff --git a/Cargo.toml b/Cargo.toml index bc1f846..6fc61f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,10 +48,7 @@ ratatui = { version = "0.29", features = ["serde", "macros"] } better-panic = "0.3" signal-hook = "0.3" human-panic = "2.0" -# FIXME: we probably don't need strum anymore -strum = { version = "0.26", features = ["derive"] } parking_lot = "0.12" -thiserror = "2.0" nucleo = "0.5" toml = "0.8" lazy-regex = { version = "3.4.1", features = [ diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 781deb1..0000000 --- a/TODO.md +++ /dev/null @@ -1 +0,0 @@ -- checkout the `which` crate for searching binaries diff --git a/television/channels/mod.rs b/television/channels/mod.rs index f28e822..a49887a 100644 --- a/television/channels/mod.rs +++ b/television/channels/mod.rs @@ -8,7 +8,6 @@ pub mod cable; pub mod entry; pub mod preview; pub mod remote_control; -// pub mod stdin; /// The interface that all television channels must implement. /// @@ -116,10 +115,6 @@ pub trait OnAir: Send { #[allow(dead_code, clippy::module_name_repetitions)] #[derive(Broadcast)] pub enum TelevisionChannel { - /// The standard input channel. - /// - /// This channel allows to search through whatever is passed through stdin. - // Stdin(stdin::Channel), /// The remote control channel. /// /// This channel allows to switch between different channels. @@ -143,7 +138,6 @@ impl TelevisionChannel { pub fn name(&self) -> String { match self { TelevisionChannel::Cable(channel) => channel.name.clone(), - // TelevisionChannel::Stdin(_) => String::from("Stdin"), TelevisionChannel::RemoteControl(_) => String::from("Remote"), } } diff --git a/television/cli/args.rs b/television/cli/args.rs index 571d484..f61d1d3 100644 --- a/television/cli/args.rs +++ b/television/cli/args.rs @@ -16,8 +16,7 @@ pub struct Cli { /// /// If provided, the preview command will be executed and formatted using /// the entry. - /// Example: "bat -n --color=always {}" (where {} will be replaced with - /// the entry) + /// Example: "cat {}" (where {} will be replaced with the entry) /// /// Parts of the entry can be extracted positionally using the `delimiter` /// option. diff --git a/television/config/mod.rs b/television/config/mod.rs index 6a1c56b..bd3158e 100644 --- a/television/config/mod.rs +++ b/television/config/mod.rs @@ -56,7 +56,6 @@ impl Hash for AppConfig { #[allow(dead_code)] #[derive(Clone, Debug, Serialize, Deserialize, Default, PartialEq, Hash)] -#[serde(deny_unknown_fields)] pub struct Config { /// General application configuration #[allow(clippy::struct_field_names)] @@ -342,6 +341,9 @@ mod tests { ui_scale = 40 theme = "television" + [previewers.file] + theme = "something" + [keybindings] toggle_help = ["ctrl-a", "ctrl-b"] confirm_selection = "ctrl-enter" diff --git a/television/utils/shell.rs b/television/utils/shell.rs index aa351fa..c9fc46c 100644 --- a/television/utils/shell.rs +++ b/television/utils/shell.rs @@ -1,10 +1,11 @@ +use std::fmt::Display; + use crate::cli::args::Shell as CliShell; use crate::config::shell_integration::ShellIntegrationConfig; use anyhow::Result; -use strum::Display; use tracing::debug; -#[derive(Debug, Clone, Copy, PartialEq, Display)] +#[derive(Debug, Clone, Copy, PartialEq)] pub enum Shell { Bash, Zsh, @@ -25,6 +26,18 @@ impl Default for Shell { } } +impl Display for Shell { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Shell::Bash => write!(f, "bash"), + Shell::Zsh => write!(f, "zsh"), + Shell::Fish => write!(f, "fish"), + Shell::PowerShell => write!(f, "powershell"), + Shell::Cmd => write!(f, "cmd"), + } + } +} + const SHELL_ENV_VAR: &str = "SHELL"; impl TryFrom<&str> for Shell {