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/cliargs.rs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'src/backend/cliargs.rs') 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