From 2aaee4d89f7d8ee683a0d50f21723d908dec3e46 Mon Sep 17 00:00:00 2001 From: lukeflo Date: Tue, 8 Oct 2024 22:48:53 +0200 Subject: open URLs, DOIs and PDFs + Implement opening mechanism for URLs, DOIs and PDFs + Adding logic to reset selected item after editing to same entry as before --- src/backend/bib.rs | 1 - src/backend/cliargs.rs | 23 +---------------------- 2 files changed, 1 insertion(+), 23 deletions(-) (limited to 'src/backend') diff --git a/src/backend/bib.rs b/src/backend/bib.rs index 3e0e844..bfc959d 100644 --- a/src/backend/bib.rs +++ b/src/backend/bib.rs @@ -17,7 +17,6 @@ use biblatex::{self, Bibliography}; use biblatex::{ChunksExt, Type}; -use color_eyre::eyre::ErrReport; use std::{fs, path::PathBuf}; // Set necessary fields diff --git a/src/backend/cliargs.rs b/src/backend/cliargs.rs index 31d37f0..d3a4652 100644 --- a/src/backend/cliargs.rs +++ b/src/backend/cliargs.rs @@ -15,7 +15,6 @@ // along with this program. If not, see . ///// -use core::panic; use std::path::PathBuf; use sarge::prelude::*; @@ -45,7 +44,7 @@ impl CLIArgs { PathBuf::from(&pos_args[1]) // pos_args[1].to_string() } else { - panic!("No path to bibfile provided as argument") + PathBuf::new() }; Self { helparg: cli_args.help, @@ -55,26 +54,6 @@ impl CLIArgs { } } -// Struct for positional arguments -// TODO: Can surely be improved!! -// pub struct PosArgs { -// pub bibfilearg: PathBuf, -// } - -// impl PosArgs { -// pub fn parse_pos_args() -> Self { -// let (_, pos_args) = ArgumentsCLI::parse().expect("Could not parse positional arguments"); -// Self { -// bibfilearg: if pos_args.len() > 1 { -// PathBuf::from(&pos_args[1]) -// // pos_args[1].to_string() -// } else { -// panic!("No path to bibfile provided as argument") -// }, // bibfilearg: pos_args[1].to_string(), -// } -// } -// } - pub fn help_func() -> String { let help = format!( "\ -- cgit v1.2.3