wip: remove unneeded dependencies

This commit is contained in:
Alexandre Pasmantier 2025-05-05 22:59:25 +02:00
parent ae958f82c5
commit 8930abecf4
7 changed files with 19 additions and 17 deletions

2
Cargo.lock generated
View File

@ -1424,10 +1424,8 @@ dependencies = [
"rustc-hash",
"serde",
"signal-hook",
"strum",
"television-derive",
"tempfile",
"thiserror 2.0.12",
"tokio",
"toml",
"tracing",

View File

@ -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 = [

View File

@ -1 +0,0 @@
- checkout the `which` crate for searching binaries

View File

@ -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"),
}
}

View File

@ -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.

View File

@ -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"

View File

@ -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 {