feat: add jello-types crate and update dependencies with backtrace support

This commit is contained in:
uttarayan21
2025-12-09 23:28:51 +05:30
parent 05ae9ff570
commit 73fcf9bad1
15 changed files with 636 additions and 507 deletions

View File

@@ -1,36 +1,38 @@
#[derive(Debug, clap::Parser)]
pub struct Cli {
#[clap(subcommand)]
pub cmd: SubCommand,
// #[clap(subcommand)]
// pub cmd: SubCommand,
#[command(flatten)]
pub verbosity: clap_verbosity_flag::Verbosity,
}
#[derive(Debug, clap::Subcommand)]
pub enum SubCommand {
#[clap(name = "add")]
Add(Add),
#[clap(name = "list")]
List(List),
#[clap(name = "completions")]
Completions { shell: clap_complete::Shell },
}
#[derive(Debug, clap::Args)]
pub struct Add {
#[clap(short, long)]
pub name: String,
}
#[derive(Debug, clap::Args)]
pub struct List {}
impl Cli {
pub fn completions(shell: clap_complete::Shell) {
let mut command = <Cli as clap::CommandFactory>::command();
clap_complete::generate(
shell,
&mut command,
env!("CARGO_BIN_NAME"),
&mut std::io::stdout(),
);
}
}
// #[derive(Debug, clap::Subcommand)]
// pub enum SubCommand {
// #[clap(name = "add")]
// Add(Add),
// #[clap(name = "list")]
// List(List),
// #[clap(name = "completions")]
// Completions { shell: clap_complete::Shell },
// }
//
// #[derive(Debug, clap::Args)]
// pub struct Add {
// #[clap(short, long)]
// pub name: String,
// }
//
// #[derive(Debug, clap::Args)]
// pub struct List {}
//
// impl Cli {
// pub fn completions(shell: clap_complete::Shell) {
// let mut command = <Cli as clap::CommandFactory>::command();
// clap_complete::generate(
// shell,
// &mut command,
// env!("CARGO_BIN_NAME"),
// &mut std::io::stdout(),
// );
// }
// }

View File

@@ -1,9 +1,14 @@
mod cli;
mod errors;
use api::JellyfinConfig;
use errors::*;
fn main() -> Result<()> {
tracing_subscriber::fmt::init();
color_backtrace::install();
let args = <cli::Cli as clap::Parser>::parse();
tracing_subscriber::fmt()
.with_max_level(args.verbosity)
.init();
ui_iced::ui().change_context(Error)?;
Ok(())
}