mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-07 12:05:34 +00:00
wip: remove unneeded dependencies
This commit is contained in:
parent
ae958f82c5
commit
8930abecf4
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1424,10 +1424,8 @@ dependencies = [
|
|||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"serde",
|
"serde",
|
||||||
"signal-hook",
|
"signal-hook",
|
||||||
"strum",
|
|
||||||
"television-derive",
|
"television-derive",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror 2.0.12",
|
|
||||||
"tokio",
|
"tokio",
|
||||||
"toml",
|
"toml",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
@ -48,10 +48,7 @@ ratatui = { version = "0.29", features = ["serde", "macros"] }
|
|||||||
better-panic = "0.3"
|
better-panic = "0.3"
|
||||||
signal-hook = "0.3"
|
signal-hook = "0.3"
|
||||||
human-panic = "2.0"
|
human-panic = "2.0"
|
||||||
# FIXME: we probably don't need strum anymore
|
|
||||||
strum = { version = "0.26", features = ["derive"] }
|
|
||||||
parking_lot = "0.12"
|
parking_lot = "0.12"
|
||||||
thiserror = "2.0"
|
|
||||||
nucleo = "0.5"
|
nucleo = "0.5"
|
||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
lazy-regex = { version = "3.4.1", features = [
|
lazy-regex = { version = "3.4.1", features = [
|
||||||
|
@ -8,7 +8,6 @@ pub mod cable;
|
|||||||
pub mod entry;
|
pub mod entry;
|
||||||
pub mod preview;
|
pub mod preview;
|
||||||
pub mod remote_control;
|
pub mod remote_control;
|
||||||
// pub mod stdin;
|
|
||||||
|
|
||||||
/// The interface that all television channels must implement.
|
/// The interface that all television channels must implement.
|
||||||
///
|
///
|
||||||
@ -116,10 +115,6 @@ pub trait OnAir: Send {
|
|||||||
#[allow(dead_code, clippy::module_name_repetitions)]
|
#[allow(dead_code, clippy::module_name_repetitions)]
|
||||||
#[derive(Broadcast)]
|
#[derive(Broadcast)]
|
||||||
pub enum TelevisionChannel {
|
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.
|
/// The remote control channel.
|
||||||
///
|
///
|
||||||
/// This channel allows to switch between different channels.
|
/// This channel allows to switch between different channels.
|
||||||
@ -143,7 +138,6 @@ impl TelevisionChannel {
|
|||||||
pub fn name(&self) -> String {
|
pub fn name(&self) -> String {
|
||||||
match self {
|
match self {
|
||||||
TelevisionChannel::Cable(channel) => channel.name.clone(),
|
TelevisionChannel::Cable(channel) => channel.name.clone(),
|
||||||
// TelevisionChannel::Stdin(_) => String::from("Stdin"),
|
|
||||||
TelevisionChannel::RemoteControl(_) => String::from("Remote"),
|
TelevisionChannel::RemoteControl(_) => String::from("Remote"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,7 @@ pub struct Cli {
|
|||||||
///
|
///
|
||||||
/// If provided, the preview command will be executed and formatted using
|
/// If provided, the preview command will be executed and formatted using
|
||||||
/// the entry.
|
/// the entry.
|
||||||
/// Example: "bat -n --color=always {}" (where {} will be replaced with
|
/// Example: "cat {}" (where {} will be replaced with the entry)
|
||||||
/// the entry)
|
|
||||||
///
|
///
|
||||||
/// Parts of the entry can be extracted positionally using the `delimiter`
|
/// Parts of the entry can be extracted positionally using the `delimiter`
|
||||||
/// option.
|
/// option.
|
||||||
|
@ -56,7 +56,6 @@ impl Hash for AppConfig {
|
|||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, Default, PartialEq, Hash)]
|
#[derive(Clone, Debug, Serialize, Deserialize, Default, PartialEq, Hash)]
|
||||||
#[serde(deny_unknown_fields)]
|
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
/// General application configuration
|
/// General application configuration
|
||||||
#[allow(clippy::struct_field_names)]
|
#[allow(clippy::struct_field_names)]
|
||||||
@ -342,6 +341,9 @@ mod tests {
|
|||||||
ui_scale = 40
|
ui_scale = 40
|
||||||
theme = "television"
|
theme = "television"
|
||||||
|
|
||||||
|
[previewers.file]
|
||||||
|
theme = "something"
|
||||||
|
|
||||||
[keybindings]
|
[keybindings]
|
||||||
toggle_help = ["ctrl-a", "ctrl-b"]
|
toggle_help = ["ctrl-a", "ctrl-b"]
|
||||||
confirm_selection = "ctrl-enter"
|
confirm_selection = "ctrl-enter"
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
use std::fmt::Display;
|
||||||
|
|
||||||
use crate::cli::args::Shell as CliShell;
|
use crate::cli::args::Shell as CliShell;
|
||||||
use crate::config::shell_integration::ShellIntegrationConfig;
|
use crate::config::shell_integration::ShellIntegrationConfig;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use strum::Display;
|
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Display)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub enum Shell {
|
pub enum Shell {
|
||||||
Bash,
|
Bash,
|
||||||
Zsh,
|
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";
|
const SHELL_ENV_VAR: &str = "SHELL";
|
||||||
|
|
||||||
impl TryFrom<&str> for Shell {
|
impl TryFrom<&str> for Shell {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user